-
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
[Broker] Fix direct memory leak in getLastMessageId #10977
Merged
merlimat
merged 1 commit into
apache:master
from
lhotari:lh-fix-direct-memory-leak-in-getLastMessageId
Jun 19, 2021
Merged
[Broker] Fix direct memory leak in getLastMessageId #10977
merlimat
merged 1 commit into
apache:master
from
lhotari:lh-fix-direct-memory-leak-in-getLastMessageId
Jun 19, 2021
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
approved these changes
Jun 18, 2021
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.
LGTM
@codelipenghui PTAL
aahmed-se
approved these changes
Jun 18, 2021
aahmed-se
approved these changes
Jun 18, 2021
BewareMyPower
approved these changes
Jun 19, 2021
merlimat
approved these changes
Jun 19, 2021
eolivelli
pushed a commit
to datastax/pulsar
that referenced
this pull request
Jun 20, 2021
(cherry picked from commit 7417ca8)
lhotari
added a commit
that referenced
this pull request
Jun 21, 2021
(cherry picked from commit 7417ca8)
lhotari
added a commit
that referenced
this pull request
Jun 21, 2021
(cherry picked from commit 7417ca8)
lhotari
added a commit
to datastax/pulsar
that referenced
this pull request
Jun 21, 2021
(cherry picked from commit 7417ca8)
yangl
pushed a commit
to yangl/pulsar
that referenced
this pull request
Jun 23, 2021
bharanic-dev
pushed a commit
to bharanic-dev/pulsar
that referenced
this pull request
Mar 18, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cherry-picked/branch-2.7
Archived: 2.7 is end of life
cherry-picked/branch-2.8
Archived: 2.8 is end of life
release/2.7.3
release/2.8.1
type/bug
The PR fixed a bug or issue reported a bug
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 #7304
Motivation
See #7304 for the details. There's a memory leak when calling lastMessageId API.
I used the instructions by @megfigura in #7304 (comment) to reproduce.
In one terminal window I started pulsar-perf produce to create 5 msg/second to the topic called "test"
pulsar-perf produce -r 5 -m 100000 test
Then in another window I ran the loop to call lastMessageId in a tight loop:
In a third terminal window, I had the broker logs filtered for errors or leak logs :
The test environment was deployed with these values.yaml settings: https://github.com/lhotari/pulsar-playground/blob/f39b83b9e08f80af57fb70b1439f6c466c1f4405/test-env/1node/values.yaml
The memory leak problem reproduces almost immediately.
Modifications
Add the missing
entry.release()
call toPersistentTopic.getLastMessageId