Skip to content

Grizzly WebSocket endpoints never call adapter.close(): connection groups accumulate stale holders on reconnect #118

Description

@vharseko

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingframeworkOpenICF-java-framework

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions