Gleiphir2769 opened a new pull request, #875:
URL: https://github.com/apache/pulsar-client-go/pull/875

   ### Motivation
   
   The `availablePermitsCh` may cause the dispatcher stuck.
   
   
https://github.com/apache/pulsar-client-go/blob/0b0720ab73d7f6378b8b6ac37acbafe547c268c8/pulsar/consumer_partition.go#L1096-L1109
   
   For example, if `messageCh <- nextMessage` continueously selected 10 times, 
the `availablePermitsCh` will be filled. The next `messageCh <- nextMessage` 
will be stuck forever because `pr := <-pc.availablePermitsCh` can never be 
reached.
   
   ### Modifications
   
   Move `<-pc.availablePermitsCh` before all the `pc.availablePermitsCh<-`.
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe 
tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:


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