-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker] Fix totalAvailablePermits not reduced when removing consumer from non-persistent dispatcher #24885
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
[fix][broker] Fix totalAvailablePermits not reduced when removing consumer from non-persistent dispatcher #24885
Conversation
|
/pulsarbot rerun-failure-checks |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #24885 +/- ##
=============================================
- Coverage 74.38% 38.60% -35.78%
+ Complexity 33513 100 -33413
=============================================
Files 1913 1856 -57
Lines 149317 145334 -3983
Branches 17331 16905 -426
=============================================
- Hits 111064 56101 -54963
- Misses 29422 81647 +52225
+ Partials 8831 7586 -1245
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/pulsarbot rerun-failure-checks |
…sumer from non-persistent dispatcher (apache#24885) (cherry picked from commit ebfff58) (cherry picked from commit 8b3245f)
…sumer from non-persistent dispatcher (apache#24885) (cherry picked from commit ebfff58) (cherry picked from commit 048df0d)
…sumer from non-persistent dispatcher (apache#24885) (cherry picked from commit ebfff58) (cherry picked from commit 048df0d)
…sumer from non-persistent dispatcher (apache#24885) (cherry picked from commit ebfff58)
…sumer from non-persistent dispatcher (apache#24885) (cherry picked from commit ebfff58) (cherry picked from commit 8b3245f)
Motivation
When
NonPersistentDispatcherMultipleConsumersremoves a consumer via theremoveConsumer()method, theTOTAL_AVAILABLE_PERMITS_UPDATERis not properly decremented when there are multiple consumers (consumers' size > 1). This creates an inconsistency where the dispatcher maintains an inflated count of available permits after consumer removalModifications
Added logic in
NonPersistentDispatcherMultipleConsumers.removeConsumer()to properly decrementTOTAL_AVAILABLE_PERMITS_UPDATERby the removed consumer's available permits when consumers' size > 1Added test case
testTotalAvailablePermitsWhenRemoveConsumer()to verify:Initial permit counting works correctly
Permit reduction happens properly when removing consumers
Verifying this change
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: 3pacccccc#28