-
Notifications
You must be signed in to change notification settings - Fork 14.4k
KAFKA-18337: KafkaProducer Memory Leak in JmxReporter Class #18332
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
Conversation
…ering after being closed, which could lead to memory leaks
A label of 'needs-attention' was automatically added to this PR in order to raise the |
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.
Thanks for the PR. It seems to me that the new defensive code is right down inside the reregister
method, but I would have thought that the check on closed could be in the public methods such as init
, metricChange
and metricRemoval
. All of the MBeans were unregistered when the reporter was closed already. wdyt?
clients/src/main/java/org/apache/kafka/common/metrics/JmxReporter.java
Outdated
Show resolved
Hide resolved
Thanks for your reply! It seems that all the public methods will eventually call the |
I prefer to do the closed check on every method which synchronizes on the lock. For one thing, some methods such as |
This PR is being marked as stale since it has not had any activity in 90 days. If you If you are having difficulty finding a reviewer, please reach out on the [mailing list](https://kafka.apache.org/contact). If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed. |
This PR has been closed since it has not had any activity in 120 days. If you feel like this |
Add a close status in JmxReporter, that avoid re-registering metrics to jmx after being closed, which could lead to memory leaks
relate KAFKA-18337
Committer Checklist (excluded from commit message)