You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/11/25 23:16:15 UTC

[GitHub] bruth opened a new pull request #3054: Remove channel closure

bruth opened a new pull request #3054: Remove channel closure
URL: https://github.com/apache/pulsar/pull/3054
 
 
   ### Motivation
   
   Closing this channel introduces a data race with [this send operation](https://github.com/apache/pulsar/blob/fe2c8ee4d37e2a45dfb528592915746827416e18/pulsar-client-go/pulsar/c_consumer.go#L188) which could lead to a panic (if a send occurs on a closed channel). This was discovered using the `-race` flag with a local test.
   
   The second issue is that since the consumer is closing the channel that may be passed by the `ConsumerOptions` or `ReaderOptions`. In general, it is a better practice to leave closing the channel up to the caller.
   
   ### Modifications
   
   This change removes the closing of the message channel.
   
   One unrelated `gofmt` change is included as well.
   
   ### Result
   
   A data race will be removed.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services