BewareMyPower commented on a change in pull request #631:
URL: https://github.com/apache/pulsar-client-go/pull/631#discussion_r723350028



##########
File path: pulsar/internal/connection.go
##########
@@ -884,10 +882,8 @@ func (c *connection) Close() {
 }
 
 func (c *connection) changeState(state connectionState) {
-       c.Lock()

Review comment:
       > Are there other places in the code that call changeState with the 
assumption that it holds the lock?
   
   No. It's called only when the connection is established (in `doHandshake()`) 
or closed (in `Close()`) to notify the connection is ready or closed (in 
`waitUntilReady()`).
   
   Regarding to the `Broadcast` docs, see 
https://pkg.go.dev/[email protected]#NewCond
   
   > It is allowed but not required for the caller to hold c.L during the call.




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