jiazhai opened a new pull request #376:
URL: https://github.com/apache/pulsar-client-go/pull/376


   Fixes #366
   
   ### Motivation
   
   In current code of `pulsar/internal/connection.go` we have 2 channels, 
closeCh and incomingRequestsCh. when the connection closes, the current mis-use 
of these 2 channels may have a deadlock. 
   PR #366 has detailed steps to reproduce and the root cause 
[analysis](https://github.com/apache/pulsar-client-go/pull/366#issuecomment-696759873)
 .
   This PR tries to fix the deadlock.
   
   ### Modifications
   - make the close logic independent, not in the same loop of normal events 
handling.
   - when the connection closed, handle the existing requests in the channel 
and return an error to avoid deadlock.
   
   ### Verifying this change
   passed the tests in #366 
   current ut passed
   


----------------------------------------------------------------
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.

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


Reply via email to