Skip to content

Handle exceptions on joined WebSocket sockets - #163

Merged
tsegismont merged 1 commit into
eclipse-vertx:mainfrom
tsegismont:issue/157
Oct 20, 2026
Merged

tsegismont merged 1 commit into
eclipse-vertx:mainfrom
tsegismont:issue/157

Conversation

@tsegismont

Copy link
Copy Markdown
Member

See #157

After a successful WebSocket upgrade (101), the two joined NetSockets had no exceptionHandler set. When a peer reset its connection, the exception propagated to ConnectionBase#handleException which logged at ERROR level, producing noisy misleading lines for routine events.

Set exceptionHandler on both the client and backend NetSockets. Each handler logs at trace level and closes the peer socket.

Extract sendWebSocketRequest and sendWebSocketResponse methods from the Proxy inner class to reduce the size of sendRequest and sendResponse.

Add two tests for post-upgrade socket closure:

  • Client closes after upgrade, backend socket is closed
  • Backend closes after upgrade, client socket is closed

Assisted-By: Claude Opus 4.6

See eclipse-vertx#157

After a successful WebSocket upgrade (101), the two joined `NetSocket`s had no `exceptionHandler` set.
When a peer reset its connection, the exception propagated to `ConnectionBase#handleException` which logged at ERROR level, producing noisy misleading lines for routine events.

Set `exceptionHandler` on both the client and backend `NetSocket`s. Each handler logs at trace level and closes the peer socket.

Extract `sendWebSocketRequest` and `sendWebSocketResponse` methods from the `Proxy` inner class to reduce the size of `sendRequest` and `sendResponse`.

Add two tests for post-upgrade socket closure:
- Client closes after upgrade, backend socket is closed
- Backend closes after upgrade, client socket is closed

Assisted-By: Claude Opus 4.6
Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
@tsegismont tsegismont added this to the 5.3.0 milestone Oct 20, 2026
@tsegismont
tsegismont merged commit 6cd1c8c into eclipse-vertx:main Oct 20, 2026
5 checks passed
@tsegismont
tsegismont deleted the issue/157 branch October 20, 2026 14:34
tsegismont added a commit that referenced this pull request Oct 20, 2026
See #157

After a successful WebSocket upgrade (101), the two joined `NetSocket`s had no `exceptionHandler` set.
When a peer reset its connection, the exception propagated to `ConnectionBase#handleException` which logged at ERROR level, producing noisy misleading lines for routine events.

Set `exceptionHandler` on both the client and backend `NetSocket`s. Each handler logs at trace level and closes the peer socket.

Extract `sendWebSocketRequest` and `sendWebSocketResponse` methods from the `Proxy` inner class to reduce the size of `sendRequest` and `sendResponse`.

Add two tests for post-upgrade socket closure:
- Client closes after upgrade, backend socket is closed
- Backend closes after upgrade, client socket is closed

Assisted-By: Claude Opus 4.6


(cherry picked from commit 6cd1c8c)

Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant