KeepAliveTimeout option causes multiple connections to be created and orphaned
jotto opened this issue · comments
Jonathan Otto commented
If you're blocking on ReadMessage()
, while the goroutine for KeepAliveTimeout
fires a closeAndReconnect
, the ReadMessage
will fire a second closeAndReconnect
. This causes more and more connections to be created and orphaned.
Ihor commented
The root cause of the bug is simultaneous running of the connect
goroutines.
Please take a look at #34 - should be fixed there.
Dmitrii Prisacari commented
The issue is still present
Salikh Fakhrutdinov commented
Please look my pr #56
Here problem in twice call go connect()
- first from method
keepAlive()
, the timer channel waiting can call any time, because of thisclose()
method doesn't work, if use keepAlive() - second from any place there have call
CloseAndReconnect()
method