Jim-Lambert-Bose opened a new issue #118: Data race: type client.handers map is 
not concurrent safe
URL: https://github.com/apache/pulsar-client-go/issues/118
 
 
   #### Expected behavior
   
   Client should be concurrent safe.  Writes to client.handlers marking them 
closable should never cause a panic. 
   
   #### Actual behavior
   
   Current implementation allows a race condition since there is no sync.Mutex 
or something similar protect concurrent writes to the map index.  Examples:
   
   - 
https://github.com/apache/pulsar-client-go/blob/e65b4795a5928d7989c3089dca5e5243439160dd/pulsar/client_impl.go#L96
   - 
https://github.com/apache/pulsar-client-go/blob/e65b4795a5928d7989c3089dca5e5243439160dd/pulsar/client_impl.go#L106
   
   #### Steps to reproduce
   
   Run two goroutines creating subscribers or producers... or just run some 
tests using the race detector.
   
   I'll submit a PR for this in a few minutes.

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


With regards,
Apache Git Services

Reply via email to