222twotwotwo opened a new pull request, #137:
URL: https://github.com/apache/dubbo-getty/pull/137

   
   
   <!--  Thanks for sending a pull request! 
   -->
   
   **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**:
   <!--
   *Automatically closes linked issue when PR is merged.
   Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
   _If PR is about `failing-tests or flakes`, please post the related 
issues/tests in a comment and do not use `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?**:
   <!--
   If no, just write "NONE" in the release-note block below.
   If yes, a release note is required:
   Enter your extended release note in the block below. If the PR requires 
additional action from users switching to the new release, include the string 
"action required".
   -->
   
   ```release-note
   NONE
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to