-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] Fix consumer does not abide by the max unacks limitation for Shared subscription #16670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I think this PR can also fix #16663 |
|
Is a similar fix needed for other dispatcher implementation classes such as PersistentDispacherSingleActiveConsumer? |
@lhotari Oh, good point. I will take a look at the Key_Shared subscription, It's might different from Shared subscription. For the single active consumer subscription, we don't have unacks limitations for now, so we don't need a fix for it. |
…n for Shared subscription (apache#16670) (cherry picked from commit 42fe060) (cherry picked from commit 8840591)
…n for Shared subscription (apache#16670)
…release' (merge request !67) branch-2.9-fix-somebug-key-share [fix][broker] Multiple consumer dispatcher stuck when unackedMessages greater than maxUnackedMessages (apache#17483) [fix][broker] Fix consumer does not abide by the max unacks limitation for Key_Shared subscription apache#16718 [fix][broker] Fix consumer does not abide by the max unacks limitation for Shared subscription apache#16670
Fixes #16667 #16673
Motivation
Fix the consumer does not abide by the max unacks limitation.
The root cause is the dispatcher only cares about the flow permits while
dispatching messages but doesn't care if the dispatched messages
will exceed the max unacks limitation.
The issue is easy to reproduce if max_unacks < receiver_queue_size
Modifications
Calculate the dispatch messages count for a consumer with
max_unacks - unacksVerifying this change
A new test added to verify the consumer will not receive
messages more than max unacks limitation
Documentation
Check the box below or label this PR directly.
Need to update docs?
doc-required(Your PR needs to update docs and you will update later)
doc-not-needed(Please explain why)
doc(Your PR contains doc changes)
doc-complete(Docs have been already added)