-
Notifications
You must be signed in to change notification settings - Fork 527
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
EventBusBridge does not cleanup if websocket is terminated exceptionally leading to memory leak #1986
Comments
@ikstewa can you verify if the fixes proposed in the PR's above solve the bug? I think they should but like you said it's hard to automate. |
Ok we can disambiguate the state by keep using close but we pass "exception" : true in the event body |
Clean up bridge state on socket exception
@pmlopes Apologies I didn't notice this earlier. The PR fixed the issue however it is logging an 'error' when this occurs. I don't believe this should be considered an error as we can't always assume a client closes the websocket connection properly. |
Version
4.0.3, 4.1.0
Context
When using the SockJSBridge, if a websocket is terminated without a close message the idle timeout timer is never cleaned up. As a result the SOCKET_IDLE events will be dispatched indefinitely.
Do you have a reproducer?
I'm unable to create a reproducer as it requires an unhealthy termination of the socket.
Possibly similar to reproducer here: #1676
When a websocket is terminated exceptionally it calls the close and exception handlers but does not call the end handler. The EventBusBridgeImpl registers the cleanup on the endHandler, but not on the exceptionHandler. (SockJSSocket does not have a closedHandler).
https://github.com/vert-x3/vertx-web/blob/master/vertx-web/src/main/java/io/vertx/ext/web/handler/sockjs/impl/EventBusBridgeImpl.java#L333
Steps to reproduce
pingTimeout
milliseconds.The text was updated successfully, but these errors were encountered: