Follow-up to #112 / #115.
#115 fixed the Jetty server so that the endpoint's close callback invokes WebSocketConnectionHolder.close(), which fires the holder's close listeners and lets the WebSocketConnectionGroup drop the departed holder. The Grizzly transports still have the original defect:
- Server:
OpenICFWebSocketApplication.OpenICFWebSocket.onClose(DataFrame) (connector-server-grizzly) drains its OperationMessageListeners but never calls adapter.close().
- Client:
ICFWebSocket.onClose(DataFrame) in ClientRemoteConnectorInfoManager (connector-framework-server) removes the adapter from privateConnections and drains listeners, but never calls adapter.close() either.
OpenICFServerAdapter.onClose only logs, so the closeListener registered by WebSocketConnectionGroup.handshake() (webSocketConnection.listeners.add(closeListener)) never fires when a connection closes. Every reconnect of the same session appends another Pair<principalName, holder> to WebSocketConnectionGroup.webSockets while the stale entries stay behind.
Fix shape: mirror the Jetty endpoint from #115 — call adapter.close() from the transport close callback (server and client), and cover it with a group-level regression test like ReconnectSendTest.testGroupDropsHolderOnClose.
Follow-up to #112 / #115.
#115 fixed the Jetty server so that the endpoint's close callback invokes
WebSocketConnectionHolder.close(), which fires the holder's close listeners and lets theWebSocketConnectionGroupdrop the departed holder. The Grizzly transports still have the original defect:OpenICFWebSocketApplication.OpenICFWebSocket.onClose(DataFrame)(connector-server-grizzly) drains itsOperationMessageListeners but never callsadapter.close().ICFWebSocket.onClose(DataFrame)inClientRemoteConnectorInfoManager(connector-framework-server) removes the adapter fromprivateConnectionsand drains listeners, but never callsadapter.close()either.OpenICFServerAdapter.onCloseonly logs, so thecloseListenerregistered byWebSocketConnectionGroup.handshake()(webSocketConnection.listeners.add(closeListener)) never fires when a connection closes. Every reconnect of the same session appends anotherPair<principalName, holder>toWebSocketConnectionGroup.webSocketswhile the stale entries stay behind.Fix shape: mirror the Jetty endpoint from #115 — call
adapter.close()from the transport close callback (server and client), and cover it with a group-level regression test likeReconnectSendTest.testGroupDropsHolderOnClose.