Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
We don't rebuild the metrics after calling shutdown. The following test can prove that.
@Test def testMetricsAfterReconfiguration(): Unit = { val logCleaner = new LogCleaner(new CleanerConfig(true), logDirs = Array(TestUtils.tempDir()), logs = new Pool[TopicPartition, UnifiedLog](), logDirFailureChannel = new LogDirFailureChannel(1), time = time) def check(): Unit = LogCleaner.MetricNames.foreach(name => assertNotNull(KafkaYammerMetrics.defaultRegistry.allMetrics().get(logCleaner.metricsGroup .metricName(name, java.util.Collections.emptyMap())), s"$name is gone?")) try { check() logCleaner.reconfigure(new KafkaConfig(TestUtils.createBrokerConfig(1, "localhost:2181")), new KafkaConfig(TestUtils.createBrokerConfig(1, "localhost:2181"))) check() } finally logCleaner.shutdown() }
Attachments
Issue Links
- links to