BewareMyPower opened a new pull request #10507:
URL: https://github.com/apache/pulsar/pull/10507


   ### Motivation
   
   It's the Java client side fix for 
https://github.com/apache/pulsar/pull/10506.
   
   When broker receives a FLOW request with zero permit, an 
IllegalArgumentException will be thrown in ServerCnx#handleFlow and then the 
connection will be closed so that the consumer will reconnect to the broker. If 
`resume()` was called for a zero queue consumer, the permits may be zero and 
trigger a reconnection. The frequent reconnections may cause messages repeated 
or out of order.
   
   ### Modifications
   
   - Validate the permits of a FLOW command before sending it.
   - Add a test that a zero queue consumer resumes and pauses for each message 
periodically. Before this PR, there's a great chance that the received messages 
are repeated or out of order, even a ACK was sent.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change added tests `ZeroQueueSizeTest#testPauseAndResumeNoReconnection`.


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


Reply via email to