bschofield commented on pull request #663:
URL: https://github.com/apache/pulsar-client-go/pull/663#issuecomment-963965511


   @BewareMyPower:
   > Therefore, I think a better solution is [...]
   
   With that solution, the bug that I am experiencing in production could still 
occur:
   
   [goroutine A] calls `c.getState()` and sees that it is not set to 
`connectionReady`
   [goroutine B] changes the state to `connectionReady`
   [goroutine B] sends a `cond.Broadcast()`, which goes nowhere because no 
goroutine is waiting.
   [goroutine A] calls `cond.Wait()`, which never completes
   
   To avoid this, it is necessary to hold the lock before calling 
`c.getState()`.
   


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


Reply via email to