Fixed server hanging on close #215

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@kenpratt

I ran into an issue with WebSocketServer not shutting down cleanly.

I traced it to the fact that I'm closing all the open sockets right before closing the server (due to some business logic that handles other cases as well), which causes two terminate calls to open sockets in rapid succession, which causes a zombie 30s timeout for cleanupWebsocketResources.

Fixed by clearing close timer in socket if terminate is called more than once in rapid succession.

Here is a gist displaying the issue: https://gist.github.com/kenpratt/6042782 (the example is a bit contrived, but that's the underlying problem I'm having). To get it working just run the server and connect with a client (I'm using https://gist.github.com/kenpratt/6042788.

Owner
3rd-Eden commented Dec 5, 2014

Fixed in master.

@3rd-Eden 3rd-Eden closed this Dec 5, 2014
kenpratt commented Dec 5, 2014

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment