RobertIndie commented on PR #1437:
URL: 
https://github.com/apache/pulsar-client-go/pull/1437#issuecomment-3544936751

   > After this change, it seems that p.Lock() in 
internalCreatePartitionsProducers becomes unnecessary because it's added to 
guarantee the safety to access the producers slice. With an atomic value, the 
slice pointed by producers is always immutable.
   
   
   Yes. We don't need the lock here in this PR. As we discussed privately, 
we’ve decided to remove the lock.
   
   I agree that removing the lock isn’t necessary in this case. However, the 
immutable-view approach used in this PR is just as straightforward (if we 
remove the producer lock) and doesn’t introduce any safety concerns. We can add 
the lock later if we  really need one.


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