-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[improve][broker] Reduce the broker close time to avoid useless wait for event loop shutdown #24895
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
Merged
lhotari
merged 7 commits into
apache:master
from
BewareMyPower:bewaremypower/improve-close
Oct 28, 2025
Merged
[improve][broker] Reduce the broker close time to avoid useless wait for event loop shutdown #24895
lhotari
merged 7 commits into
apache:master
from
BewareMyPower:bewaremypower/improve-close
Oct 28, 2025
Conversation
This file contains hidden or 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
approved these changes
Oct 27, 2025
Member
|
There are multiple test failures with similar IllegalArgumentException: |
Contributor
Author
|
Okay, let me take a look |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #24895 +/- ##
=============================================
+ Coverage 38.41% 74.27% +35.85%
- Complexity 13133 33485 +20352
=============================================
Files 1856 1913 +57
Lines 145160 149331 +4171
Branches 16846 17334 +488
=============================================
+ Hits 55760 110909 +55149
+ Misses 81815 29580 -52235
- Partials 7585 8842 +1257
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
manas-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Oct 29, 2025
…for event loop shutdown (apache#24895) (cherry picked from commit 411aea9) (cherry picked from commit 61f6fcd)
guptas6est
pushed a commit
to Nordix/pulsar
that referenced
this pull request
Oct 30, 2025
…for event loop shutdown (apache#24895)
srinath-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Nov 6, 2025
…for event loop shutdown (apache#24895) (cherry picked from commit 411aea9) (cherry picked from commit 61f6fcd)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cherry-picked/branch-4.0
cherry-picked/branch-4.1
doc-not-needed
Your PR changes do not impact docs
ready-to-test
release/4.0.8
release/4.1.2
type/enhancement
The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
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 #24894
Motivation
Currently the
quietPeriodparameter in Netty graceful shutdown in milliseconds is determined by the minimal value of 5000 andbrokerShutdownTimeoutMs/ 4 (default: 15000), which is unnecessarily large and could wait for too long with no pending tasks in the executor.Modifications
quietPeriodargument as a small value (1 ms)BrokerEventLoopShutdownTestto avoid the regressionIt should be noted that setting 1 ms as the
quietPeriodmakes sense. It has been explained in #24894 (comment) and more details can be found in https://github.com/netty/netty/blob/6bb1a6bcae503423343b9155ac48b161f60368b5/common/src/main/java/io/netty/util/concurrent/SingleThreadEventExecutor.javaHere is the best practice suggested by AI:
Verifying this change
After this change, the
BrokerEventLoopShutdownTestcan pass and the logs might look like:Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: