-
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
Disconnection Event Lost #2852
Comments
I'd like to update my observations: recording over a longer period yields a result indicating there is no correlation between default/namespaced connects and the number of lost disconnects:
Please be aware that the recorded exceptions now include the interval based workaround wich manually disconnects a lost socket. This is why the the namespaced connects and disconnects match so closely. I can see that the number of sockets in the default namespace is higher than the difference of recorded connects and disconnects. I suspect this is because some of these are waiting for re-connection. But it is safe to say that there is no perfectly clear connection between the number of lost disconnects and the number of default/namespaced connects. |
I noticed the same thing and was also unable to reproduce the cause. The workaround seems a good way to at least detect this. Thanks for your insight! |
I believe I am seeing this too. The only additional information I can provide is that it seems to be happening to users with really spotty internet connections i.e. users that connect and disconnect a lot (usually with a 'ping timeout'). |
@sgrtho & others: Does this issue still exist in the latest version of Socket.IO (2.0.4)? We are currently using version 1.7.2 and may experience this problem as well. |
Hey, I can't really say. We did not yet migrate to 2.x (probably never will). |
I don't think my issue was with socket.io but I ended up removing it from all my projects. I use |
Closed due to inactivity, please reopen if needed. |
I want to:
This report may or may not be related to issues #2544 and/or #2565.
Current behaviour
Sometimes connected sockets (which received a connection event) won't receive the disconnect event although they are removed from the sockets object and (most likely) disappear from socket.io server.
Steps to reproduce / Side effects
I have been unable to safely reproduce this issue and it only occurs in non-debug environment (like our beta servers). But I can elaborate on observed side effects, which may help to pinpoint the problem source (or my confusion...).
We handle a namespaced connection:
Where the handler looks like this:
Using this code I regularly receive the disconnect-lost exception detected by the interval workaround. No error events occur, no other exceptions show up.
The only significant detail I could find, occurs when I also listen on the default namespace:
There I also report connection, disconnect and error events. It seems that in a case where a disconnect is lost the socket does enter the namespaced listener but is not reaching the default listener, which I can derive from the exceptions I recorded:
Here you can see that the counter for global-connect is smaller than namespaced-connect, 63 vs. 64. I think it is exactly the same socket which drops the disconnect event. More on that:
You can see that the disconnect actually fires once I manually disconnect the socket. I performed all theses actions in single sync run and the counter of namespaced-disconnect increased by one. Any ideas?
Expected behaviour
If a socket receives a connection event it should always receive a disconnect event, no matter if in a namespace or not.
Setup
The text was updated successfully, but these errors were encountered: