Skip to content

fix: close websocket self-connect connections - #136

Merged
AlexStocks merged 2 commits into
apache:masterfrom
222twotwotwo:fix-WebSocket-self-connect-rejection-leaks-the-upgraded-connection
Jul 23, 2026
Merged

fix: close websocket self-connect connections#136
AlexStocks merged 2 commits into
apache:masterfrom
222twotwotwo:fix-WebSocket-self-connect-rejection-leaks-the-upgraded-connection

Conversation

@222twotwotwo

Copy link
Copy Markdown

What this PR does:

Closes the upgraded WebSocket connection when a self-connect request is rejected, preventing the socket/resource from leaking on that path.

Also adds a regression test covering the upgraded self-connect branch and verifying that:

  • the WebSocket upgrade succeeds
  • session creation is skipped
  • the upgraded connection is closed before returning

Which issue(s) this PR fixes:

Fixes #132

Special notes for your reviewer:

Tested with:

go test -run TestWSServeWSRequestClosesSelfConnectConn -count=1
go test ./... -count=1
go vet ./...
git diff --check

Does this PR introduce a user-facing change?:

NONE

@AlexStocks

Copy link
Copy Markdown

同理,给上游代码也来个PR

@AlexStocks
AlexStocks merged commit 3e44e4a into apache:master Jul 23, 2026
2 checks passed
@222twotwotwo

Copy link
Copy Markdown
Author

同理,给上游代码也来个PR

OK, done.

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.

[BUG] transport review findings: shutdown deadlock, nil-listener panic, websocket leak, and reconnect lifecycle issues

2 participants