[ 
https://issues.apache.org/jira/browse/KAFKA-6307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300992#comment-16300992
 ] 

ASF GitHub Bot commented on KAFKA-6307:
---------------------------------------

omkreddy commented on a change in pull request #4307: KAFKA-6307 mBeanName 
should be removed before returning from JmxReporter#removeAttribute()
URL: https://github.com/apache/kafka/pull/4307#discussion_r158433830
 
 

 ##########
 File path: 
clients/src/test/java/org/apache/kafka/common/metrics/JmxReporterTest.java
 ##########
 @@ -35,6 +36,7 @@ public void testJmxRegistration() throws Exception {
         Metrics metrics = new Metrics();
         MBeanServer server = ManagementFactory.getPlatformMBeanServer();
         try {
+            JmxReporter reporter = new JmxReporter();
 
 Review comment:
   looks like this is not passed to Metrics object. we can use reporter 
instance at below line.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> mBeanName should be removed before returning from 
> JmxReporter#removeAttribute()
> -------------------------------------------------------------------------------
>
>                 Key: KAFKA-6307
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6307
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Assignee: siva santhalingam
>
> JmxReporter$KafkaMbean showed up near the top in the first histo output from 
> KAFKA-6199.
> In JmxReporter#removeAttribute() :
> {code}
>         KafkaMbean mbean = this.mbeans.get(mBeanName);
>         if (mbean != null)
>             mbean.removeAttribute(metricName.name());
>         return mbean;
> {code}
> mbeans.remove(mBeanName) should be called before returning.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to