socket.io failing over time for Chrome and Firefox
See original GitHub issueYou want to:
- report a bug
- request a feature
Current behaviour
We cannot reproduce this reliably, but this is a description of our server setup and issue.
We are running socket.io 2.2.0 on a Node.JS/Express server.
After about 12 hours our server does not respond to emissions from clients on desktop Chrome and Firefox. It continues to function on Edge, Safari, and mobile Chrome/Safari.
For example:
Server:
io.on('connection', (socket) => {
socket.on(‘test’, (data) => {
console.log(“This is a test”)
})
})
Client:
this.socket.emit(‘test’)
In this example, we see the expected behavior during the first 12 or so hours of the server’s uptime. “This is a test” is fired as soon as the client emits.
After that, perhaps due to gradual load on the server (though we typically never have more than 20 clients connected at once), the server stops listening to the client. Despite verifying that the client has emitted ‘test’, the server never logs “This is a test”. Again, this only occurs on desktop Chrome and desktop Firefox.
This seems odd because if the server was overloaded - it should recover when the number of clients goes down. In addition, why would excess load suddenly permanently disable the ability for Chrome and Firefox to send emissions to our server? We know that the websocket connection is being established from the client by looking at the network logs. We also see that the connection is sending pings but never receiving pongs from the server.
Expected behaviour
Chrome and Firefox sockets continue to operate as normal.
Setup
- OS: Ubuntu 18.04
- browser: Desktop Chrome, Desktop Firefox
- socket.io version: 2.2.0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:6 (2 by maintainers)
Top GitHub Comments
Since i updated socket io package, i don’t have this issue anymore (server running since 3 weeks now without issues)
We were working around this issue by restarting the our app fairly often, but we stopped that a while ago and everything is running as expected again. Thank you very much 👍