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


   Master issue: #462
   
   ### Motivation
   
   In some cases consumer `Close` method might be called in nearly the same 
moment with background partiotion discovery routine tick. When `Close` acquires 
mutex first, it will release all underlying consumers, but that not guarantees 
backgound routine's not wait for the same mutex in 
`internalTopicSubscribeToPartitions`, so when `Close` completes, mutex gets 
acquired by not-finished-yet goroutine leading to new partition consumers gets 
created without any chance to close them.
   
   This PR modifies background discrobery goroutine the way it will be closed 
before acquiring mutex in `Close` method.
   
   ### Modifications
   
   Described above.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (yes / no)
     - The public API: (yes / no)
     - The schema: (yes / no / don't know)
     - The default values of configurations: (yes / no)
     - The wire protocol: (yes / no)
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / GoDocs / 
not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a followup 
issue for adding the documentation
   


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