You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/10/01 13:33:32 UTC

[GitHub] [pulsar-client-go] jiazhai opened a new pull request #376: Fix deadlock when connection closed

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:
users@infra.apache.org



[GitHub] [pulsar-client-go] jiazhai commented on pull request #376: Fix deadlock when connection closed

Posted by GitBox <gi...@apache.org>.
jiazhai commented on pull request #376:
URL: https://github.com/apache/pulsar-client-go/pull/376#issuecomment-705944651


   Thanks @wolfstudy for the help


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy merged pull request #376: Fix deadlock when connection closed

Posted by GitBox <gi...@apache.org>.
wolfstudy merged pull request #376:
URL: https://github.com/apache/pulsar-client-go/pull/376


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar-client-go] jiazhai commented on pull request #376: Fix deadlock when connection closed

Posted by GitBox <gi...@apache.org>.
jiazhai commented on pull request #376:
URL: https://github.com/apache/pulsar-client-go/pull/376#issuecomment-705944651


   Thanks @wolfstudy for the help


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar-client-go] wolfstudy merged pull request #376: Fix deadlock when connection closed

Posted by GitBox <gi...@apache.org>.
wolfstudy merged pull request #376:
URL: https://github.com/apache/pulsar-client-go/pull/376


   


----------------------------------------------------------------
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:
users@infra.apache.org