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

Server shutdown closes websockets with wrong close code #6

Open
sergio91pt opened this issue Dec 30, 2016 · 3 comments
Open

Server shutdown closes websockets with wrong close code #6

sergio91pt opened this issue Dec 30, 2016 · 3 comments

Comments

@sergio91pt
Copy link

Shutting down dropwizard closes all websockets with close code 1000 NORMAL_CLOSURE, instead of the correct one 1001 GOING_AWAY.

This impacts robust-websocket, which won't trigger a reconnection in case of a server restart because the server initiated closure is marked as normal.

@sergio91pt
Copy link
Author

WebSocketServerFactory#onStop does close all open sessions with StatusCode.SHUTDOWN, but the fact remains that dropwizard does not (double checked with wireshark).

I added a breakpoint to the close method in AbstractWebSocketConnection. After sending a TERM signal to dropwizard it triggered, but not due to WebSocketServerFactory...

Thread [dw-24] (Suspended (breakpoint at line 249 in AbstractWebSocketConnection))  
    WebSocketServerConnection(AbstractWebSocketConnection).close() line: 249    
    SelectorManager$ManagedSelector.closeNoExceptions(Closeable) line: 724  
    SelectorManager$ManagedSelector.access$1100(SelectorManager$ManagedSelector, Closeable) line: 407   
    SelectorManager$ManagedSelector$EndPointCloser.run() line: 1031 
    InstrumentedQueuedThreadPool(QueuedThreadPool).runJob(Runnable) line: 635   
    QueuedThreadPool$3.run() line: 555  
    Thread.run() line: 745  

@TomCools
Copy link
Owner

I had abandoned this project, but am reviving it for DW 4. Will be looking into this.

@TomCools TomCools added this to the Dropwizard 4.0 compatibility milestone May 19, 2022
@TomCools
Copy link
Owner

Now that DW 4.0 is out, I'll be picking this up again.

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

No branches or pull requests

2 participants