[fix][flaky-test] Set the receiverQueueSize is 1 to precisely control the maxUnackedMessages. #16671
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
#16663
Currently,
MaxUnackedMessagesOnConsumerdo not precisely control.If one Consumer
MaxUnackedMessagesOnConsumeris 100, and currentunackedMessagessize is 95.When 10 messages are read again, they may be sent to this consumer again. Because this check
unackedMessages:95<MaxUnackedMessagesOnConsumer:100not blocked, and 105 unacked messages are eventually sent to the consumer.Modifications
I don't think this is a problem, we don't need to make changes on the broker side.
We can modify the size of
consumer.receiverQueuein the unit test to be 1, so as to ensure that each time the message is read from bk, it is 1 to make this test stable.Documentation
Tell the user that the value is not precisely controlled.
doc(Your PR contains doc changes)