machi1990 commented on code in PR #13700:
URL: https://github.com/apache/kafka/pull/13700#discussion_r1234159704


##########
core/src/test/scala/unit/kafka/server/ClientQuotaManagerTest.scala:
##########
@@ -418,6 +418,17 @@ class ClientQuotaManagerTest extends 
BaseClientQuotaManagerTest {
     }
   }
 
+  @Test
+  def 
testDelayedQueueSensorShouldShouldExistAfterInstantiationAndBeRemovedAfterShutdown():
 Unit = {
+    val sensorName = Produce.toString + "-delayQueue"
+    val clientQuotaManager = new ClientQuotaManager(config, metrics, Produce, 
time, "")
+    var delayedQueueSensor = metrics.getSensor(sensorName)
+    assertNotNull(delayedQueueSensor, "delayed queue sensor should exist")
+    clientQuotaManager.shutdown()
+    delayedQueueSensor = metrics.getSensor(sensorName)

Review Comment:
   I looked onto this and apparently the metrics.metrics() List is never empty 
because this metric 
https://github.com/apache/kafka/blob/ca11a87e86e8e3c65043f747f35cae770b1efb7c/clients/src/main/java/org/apache/kafka/common/metrics/Metrics.java#L180
 isn't at the moment removed when we `Metrics#close()` is called.
   
   Is that to be expected? If not, I can create a separate JIRA and address it 
separate from this PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to