ijuma commented on a change in pull request #9728: URL: https://github.com/apache/kafka/pull/9728#discussion_r552037417
########## File path: core/src/main/scala/kafka/log/LogManager.scala ########## @@ -1167,6 +1160,21 @@ class LogManager(logDirs: Seq[File], object LogManager { + /** + * wait all jobs to complete + * @param jobs jobs + * @param callback handle the exception caused by Future#get Review comment: We should mention that this will be called for each future that throws an exception. ########## File path: core/src/test/scala/unit/kafka/log/LogManagerTest.scala ########## @@ -680,4 +681,31 @@ class LogManagerTest { time.sleep(logConfig.fileDeleteDelayMs + 1) verifyMetrics(1) } + + @Test + def testWaitForAllToComplete(): Unit = { + var invokedCount = 0 + val success: Future[Boolean] = Mockito.mock(classOf[Future[Boolean]]) + Mockito.when(success.get()).thenAnswer(_ => invokedCount += 1) Review comment: Should we not return `true` in this answer? ########## File path: core/src/main/scala/kafka/log/LogManager.scala ########## @@ -1167,6 +1160,21 @@ class LogManager(logDirs: Seq[File], object LogManager { + /** + * wait all jobs to complete Review comment: Nit: start with capital? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org