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 closing of AbstractDispatcherSingleActiveConsumer and reduce flakiness of test #21736
Merged
lhotari
merged 9 commits into
apache:master
from
lhotari:lh-fix-SubscriptionMessageDispatchThrottlingTest
Dec 19, 2023
Merged
[fix][broker] Fix closing of AbstractDispatcherSingleActiveConsumer and reduce flakiness of test #21736
lhotari
merged 9 commits into
apache:master
from
lhotari:lh-fix-SubscriptionMessageDispatchThrottlingTest
Dec 19, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lhotari
changed the title
[fix][test] Fix flaky SubscriptionMessageDispatchThrottlingTest
[fix][test] Reduce flakiness in SubscriptionMessageDispatchThrottlingTest
Dec 17, 2023
lhotari
changed the title
[fix][test] Reduce flakiness in SubscriptionMessageDispatchThrottlingTest
[fix][broker] Fix closing of AbstractDispatcherSingleActiveConsumer and reduce flakiness of test
Dec 17, 2023
lhotari
added
type/bug
The PR fixed a bug or issue reported a bug
area/broker
release/3.0.3
release/2.11.4
release/3.1.3
labels
Dec 17, 2023
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #21736 +/- ##
=============================================
+ Coverage 30.33% 73.41% +43.08%
- Complexity 326 32785 +32459
=============================================
Files 1719 1897 +178
Lines 131059 140622 +9563
Branches 14320 15486 +1166
=============================================
+ Hits 39759 103242 +63483
+ Misses 85315 29310 -56005
- Partials 5985 8070 +2085
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Technoboy-
reviewed
Dec 18, 2023
...r/src/main/java/org/apache/pulsar/broker/service/AbstractDispatcherSingleActiveConsumer.java
Show resolved
Hide resolved
- dispatcher rate limiter should also be closed
- should update existing rate limiter when rate limiting gets disabled
lhotari
force-pushed
the
lh-fix-SubscriptionMessageDispatchThrottlingTest
branch
from
December 19, 2023 10:54
460470e
to
bfe63e4
Compare
This was referenced Dec 19, 2023
Technoboy-
approved these changes
Dec 19, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/broker
doc-not-needed
Your PR changes do not impact docs
ready-to-test
type/bug
The PR fixed a bug or issue reported a bug
type/flaky-tests
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.
Fixes #21756
Motivation & Modifications
Closing of AbstractDispatcherSingleActiveConsumer should also close the underlying rate limiter. This will leaks resources in rate limiters that hold on resources (before PIP-322 changes, thus relevant to maintenance branches). The SubscriptionMessageDispatchThrottlingTest consistently fails since closing is missing.
In addition to this, reduce flakiness in SubscriptionMessageDispatchThrottlingTest.
Often the timeouts are too short. There shouldn't be a need to have strict 500 ms timeouts in tests. Remove Awaitility "atMost" timeouts and rely on default (10 secs). Change all test timeouts to 30 seconds in the class.
Additional context
It looks like PR #21682 changes broke closing in certain cases. That problem is now fixed in this PR.
This impacted
PersistentDispatcherSingleActiveConsumer.close(boolean disconnectClients, Optional<BrokerLookupData> assignedBrokerLookupData)
method call which is implemented inAbstractDispatcherSingleActiveConsumer
. That method didn't close the rate limiter and it's now included in this PR.Documentation
doc
doc-required
doc-not-needed
doc-complete