BewareMyPower opened a new pull request #10506: URL: https://github.com/apache/pulsar/pull/10506
### Motivation 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 `resumeMessageListener()` was called for a zero queue consumer, the permits may be zero and trigger a reconnection. The frequent reconnection may cause messages repeated or out of order. ### Modifications - Check the permits of FLOW command - 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#testPauseResumeNoReconnection`. -- 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]
