Skip to content
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

Fix possible race condition in websocket heartbeat callback #179

Merged
merged 1 commit into from
Apr 29, 2016

Conversation

dordille
Copy link

@dordille dordille commented Jun 2, 2015

Under load I was seeing cases where heartbeat_timeout was being called when the session had already been set to null.

@brycekahle
Copy link
Contributor

I appreciate the PR. I'd like to find out the source of race condition instead of just treating the symptom. Do you have any more information on when you were seeing the error?

@Slayer95
Copy link

Slayer95 commented Dec 5, 2015

I suppose this happens if the session is closed in the 10 second window for receiving client's ping.

I'd expect calling clearTimeout when unregistering the session to fix the issue cleanly.

@JADurham909
Copy link

JADurham909 commented Apr 18, 2016

We are seeing this too when running webpack-dev-server. I will try to get more information.

TypeError: Cannot read property 'close' of null     at WebSocketReceiver.heartbeat_timeout (/Users/james/.npm-packages/lib/node_modules/webpack-dev-server/node_modules/sockjs/lib/trans-websocket.js:157:26)     at null._onTimeout (/Users/james/.npm-packages/lib/node_modules/webpack-dev-server/node_modules/sockjs/lib/trans-websocket.js:75:24)     at Timer.listOnTimeout (timers.js:92:15)

@tmds
Copy link

tmds commented Apr 19, 2016

ref #185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants