Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There was a deadlock situation when we didn't receive an expected pingresp, keepalive() called internalConnLost() synchronously, that waits for all workers to exit before it returns, but keepalive() is one of those workers... Also there was an issue when returning from keepalive() that we'd call the waitgroup broadcasts before c.stop had been closed, causing them to fall through and then get stuck at the Wait(), which would cause keepalive() not to finish returning and call workers.Done(), etc... locked again. Changed this to use a pingstop channel for the timer reset go funcs that is closed at the beginning of the exit func for keepalive() ensuring the following broadcasts will cause them all to exit properly. resolve#129
- Loading branch information