Skip to content

Fix nil listener callback - #137

Merged
AlexStocks merged 2 commits into
apache:masterfrom
222twotwotwo:fix-nil-listener-callback
Jul 20, 2026
Merged

Fix nil listener callback#137
AlexStocks merged 2 commits into
apache:masterfrom
222twotwotwo:fix-nil-listener-callback

Conversation

@222twotwotwo

Copy link
Copy Markdown

What this PR does:

  • fix the nil listener guard in handlePackage error cleanup by requiring both session and listener before calling OnError
  • guard OnClose when the listener is nil so the same cleanup path does not panic one line later
  • add a regression test for the nil-listener error cleanup path

Which issue(s) this PR fixes:

Fixes #132

Special notes for your reviewer:

The cleanup path used s != nil || s.listener != nil, so a non-nil session with a nil listener still attempted to call s.listener.OnError(...) and could panic while handling an existing read/decode error.

Does this PR introduce a user-facing change?:

NONE

@AlexStocks

Copy link
Copy Markdown

这个问题,给上游 alexstocks/getty 也来个 PR @222twotwotwo

@AlexStocks
AlexStocks merged commit 029982a into apache:master Jul 20, 2026
2 checks passed
@222twotwotwo

Copy link
Copy Markdown
Author

这个问题,给上游 alexstocks/getty 也来个 PR @222twotwotwo

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