fixed latch waiting if somehow first-connection fails
Merge pull request #1747 from gurbuzali/fix-broken-build/3.x-master

fixed latch waiting if somehow first-connection fails