-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 the broker close hanged issue. #15755
Merged
Merged
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
eolivelli
reviewed
May 25, 2022
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/coordination/impl/LockManagerImpl.java
Outdated
Show resolved
Hide resolved
Technoboy-
changed the title
[WIP]Fix potential race condition when close LockManager
[fix][broker] Fix the broker close hanged issue.
May 25, 2022
Technoboy-
added
the
type/enhancement
The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
label
May 25, 2022
codelipenghui
approved these changes
May 25, 2022
merlimat
approved these changes
May 25, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Nice work!
mattisonchao
approved these changes
May 25, 2022
5 tasks
@Technoboy- A CI build got stuck in ModularLoadManagerImpl.disableBroker / ResourceLock.release. Is it related to this PR? Please check the stack trace at #15643 (comment) . |
Technoboy-
added a commit
to Technoboy-/pulsar
that referenced
this pull request
Sep 16, 2022
1 task
Technoboy-
added a commit
that referenced
this pull request
Sep 16, 2022
gaozhangmin
pushed a commit
to gaozhangmin/pulsar
that referenced
this pull request
Apr 6, 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
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.
Master issue #15643, #15753
Motivation
Blocked at BrokerService#unloadNamespaceBundlesGracefully:
Blocked at CoordinationServiceImpl#close
For BrokerService#unloadNamespaceBundlesGracefully, the request chain :
For CoordinationServiceImpl#close, the request chain :
We find that it's all related to ResourceLock#release.
As the CI using the MockedZooKeeper, I find that if there are some RuntimeException, the response could never finish. So I add the catch block to ensure that all the requests will reply. But I'm not sure if the return code is right.
pulsar/testmocks/src/main/java/org/apache/zookeeper/MockZooKeeper.java
Lines 332 to 402 in 3a80458
pulsar/testmocks/src/main/java/org/apache/zookeeper/MockZooKeeper.java
Lines 916 to 976 in 3a80458
More, the current close process has some order issues. LoadManager is closed before BrokerService, but BrokerService closes need to invoke LoadManager, even though the LoadManager is stateless, but is a little confused here.
pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
Lines 443 to 452 in 3a80458
pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
Lines 891 to 902 in 3a80458
Documentation
no-need-doc
(Please explain why)