Skip to content

[5.2] Handle exceptions on joined WebSocket sockets - #164

Merged
tsegismont merged 1 commit into
5.2from
backport/163-to-5.2
Oct 20, 2026
Merged

tsegismont merged 1 commit into
5.2from
backport/163-to-5.2

Conversation

@tsegismont

Copy link
Copy Markdown
Member

Backport of #163 to 5.2
Cherry-picked commit: 6cd1c8c

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

Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
(cherry picked from commit 6cd1c8c)
Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
@tsegismont
tsegismont merged commit 25cf13b into 5.2 Oct 20, 2026
5 checks passed
@tsegismont
tsegismont deleted the backport/163-to-5.2 branch October 20, 2026 14:43
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