Menu

#4 Shutdown failure using pdn in TestHubs

1.0
open
nobody
None
2026-07-29
2026-07-29
No

When i start the TestHubs application it will successfully connect with my SC implementation (based heavily off of the work in this project, so thank you!). But when i submit pdn often there will be a rejected execution exception that prevents the primary from closing properly, and leaving node connections open. Also, issuing pup after will cause a seemingly endless dump of port not available exceptions (assumed to be related to the original failure).

The fix for this as the project is now is to update WebSocketServer by moving the wsf.close() call from stop to doServerShutdown, putting it after the stopConnectionLostTimer call. Closing remaining connections forcefully is likely also a good idea:

        wsf.close();
        for( WebSocket ws : getConnections() ) {
            try {
                ws.closeConnection( CloseFrame.ABNORMAL_CLOSE, "server shutdown" );
            } catch ( RuntimeException e ) {
                log.error( "Exception during connection shutdown", e );
            }
        }

Alternatively, this problem seems to have been fixed in java_websocket a different way, so the code copy in this project could be updated. See https://github.com/TooTallNate/Java-WebSocket/issues/270.

Discussion


Log in to post a comment.