-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reconnect never happens (race conditions) #3358
Comments
Hi, I'm doing some investigation on open issues involving races (a research project). I did some investigation using the tool we have developed to exercise different callback interleavings. In current socket.io-client version, I could observe by changing the callback interleavings, the test may pass or fail. So, I added the fix proposed by @lolney and the test always passes even with different interleavings. It seems that the fix is good. |
Current behaviour
A worker does not retry to connect to the socket.io server after a failed attempt if 2 different connections were attempted (into 2 namespaces) at a specific interval.
Steps to reproduce
Other information
If we simply remove the timeout, it works. From looking at the code, it appears that the "cleanup" from the 2nd connection attempt actually "cleans up" the timer that is used for the reconnection of the first connection error.
Workaround
This is, of course, an extremely simplified use case. In our real-world application, we had to move around our requires to ensure that both connections were
The text was updated successfully, but these errors were encountered: