-
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 lookupRequestSemaphore leak when topic not found #21646
[fix][broker] Fix lookupRequestSemaphore leak when topic not found #21646
Conversation
@pengxiangrui127 Please add the following content to your PR description and select a checkbox:
|
@@ -79,6 +79,7 @@ protected CompletableFuture<LookupData> internalLookupTopicAsync(final TopicName | |||
}) | |||
.thenCompose(exist -> { | |||
if (!exist) { | |||
pulsar().getBrokerService().getLookupRequestSemaphore().release(); |
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.
A better way to fix this is moving exceptionally
(line-135) to line-139. WDYT?
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.
A better way to fix this is moving
exceptionally
(line-135) to line-139. WDYT?
thx to review. It is a good idea, i will recommit it.
cecb76b
to
9ed2d9f
Compare
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.
Could you add a test for this case?
No need to cherry-pick to branch-2.10, because 2.10 doesn't has this issue. |
Function internalLookupTopicAsync is invoked by http protocol topic lookup request. The lookupRequestSemaphore would leaked when lookuping topic is not exist.
Motivation
Modifications
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: