tyamashi-oss commented on code in PR #12296: URL: https://github.com/apache/kafka/pull/12296#discussion_r915753889
########## core/src/test/scala/unit/kafka/log/LogCleanerTest.scala: ########## @@ -1854,6 +1853,33 @@ class LogCleanerTest { } finally logCleaner.shutdown() } + @Test + def testReconfigureLogCleanerIoMaxBytesPerSecond(): Unit = { + val oldKafkaProps = TestUtils.createBrokerConfig(1, "localhost:2181") + oldKafkaProps.put(KafkaConfig.LogCleanerIoMaxBytesPerSecondProp, 10000000) + + val logCleaner = new LogCleaner(LogCleaner.cleanerConfig(new KafkaConfig(oldKafkaProps)), + logDirs = Array(TestUtils.tempDir()), + logs = new Pool[TopicPartition, UnifiedLog](), + logDirFailureChannel = new LogDirFailureChannel(1), + time = time) { + // shutdown() and startup() are called in LogCleaner.reconfigure(). + // Empty startup() and shutdown() to ensure that no unnecessary log cleaner threads remain after this test. + override def startup(): Unit = {} + override def shutdown(): Unit = {} + } + + try { + assertEquals(10000000, logCleaner.throttler.desiredRatePerSec, s"Throttler.desiredRatePerSec should be initialized from initial `${KafkaConfig.LogCleanerIoMaxBytesPerSecondProp}` config.") + + val newKafkaProps = TestUtils.createBrokerConfig(1, "localhost:2181") + newKafkaProps.put(KafkaConfig.LogCleanerIoMaxBytesPerSecondProp, 20000000) + + logCleaner.reconfigure(new KafkaConfig(oldKafkaProps), new KafkaConfig(newKafkaProps)) + + assertEquals(20000000, logCleaner.throttler.desiredRatePerSec, s"Throttler.desiredRatePerSec should be updated with new `${KafkaConfig.LogCleanerIoMaxBytesPerSecondProp}` config.") + } finally logCleaner.shutdown(); Review Comment: I've fixed it. Thank you for pointing out. https://github.com/apache/kafka/pull/12296/commits/5c727409cc03a8b459f6d30b8df888489f52d743 With this fix, the java8/scala2.12 build now succeeds. However, the `JDK 11 / Scala 2.13` build, which used to succeed, now failed. I believe this new build failure is unrelated to my changes. I tried running the same command in my local environment once and this build was successful. ``` [2022-07-07T06:22:53.589Z] > Task :streams:integrationTest FAILED [2022-07-07T06:22:53.589Z] [2022-07-07T06:22:53.589Z] FAILURE: Build failed with an exception. ``` https://ci-builds.apache.org/blue/organizations/jenkins/Kafka%2Fkafka-pr/detail/PR-12296/7/pipeline/ -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org