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
KAFKA-14866:Remove controller module metrics when broker is shutting down #13473
Conversation
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.
Thank you for the change.
Please add a unit test here which verifies that the number of calls to register metric and remove metric is same in this class. You can use verify() in Mockito to do that.
20b43ac
to
c1d7804
Compare
Hello, please help to review this PR, thank you! @divijvaidya |
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.
Added a nit, otherwise code looks good to me. As a general suggestion for this and future PRs, it helps the reviewer if your description has the following sections:
Motivation (explaining why this change is required)
Code change (what actually is being changed in the code)
Testing (how did you validate that the code changes are correct)
This PR is ready for a committer to take a look at it.
core/src/test/scala/unit/kafka/controller/KafkaControllerTest.scala
Outdated
Show resolved
Hide resolved
c1d7804
to
664eb22
Compare
I see, thanks a lot! |
And this pr. thx! @showuon |
Do other committers have time to review this PR? |
@guozhangwang Hello, can you help to review these two PRs? this and #13471 |
Hello, can you help to review this PR? @mimaison |
bump this pr, Is there any other commiters to help review and merge this pr? |
I'm sorry I didn't notice the comment ("We're past code freeze for 3.5 so moving this to the next release") in the corresponding jira |
Hey @hudeqi
Perhaps, you are make those changes in this PR as request the same committer to review this PR as well? |
664eb22
to
5d438fb
Compare
thanks! divijvaidya! |
@dajac When you get a chance, please take a look. Thanks! |
5d438fb
to
177d0e4
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.
Thanks for the PR! I left a few comments
core/src/test/scala/unit/kafka/controller/KafkaControllerTest.scala
Outdated
Show resolved
Hide resolved
core/src/test/scala/unit/kafka/controller/KafkaControllerTest.scala
Outdated
Show resolved
Hide resolved
core/src/test/scala/unit/kafka/controller/KafkaControllerTest.scala
Outdated
Show resolved
Hide resolved
177d0e4
to
b03928e
Compare
Thanks for your review, I have updated it based on your comments. @mimaison |
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, thanks for the PR
In the current situation, KafkaController started 12 related metrics at startup, but did not remove these metrics when broker shutdown.
I removed these metrics from here when it is shutdown, and added related unit tests to check to prevent forgetting to remove metrics when new metrics are added in the future.
The change has successfully passed the unit test, and when omitting to remove the metric, the unit test fails.