showuon opened a new pull request, #12639: URL: https://github.com/apache/kafka/pull/12639
Recently, we got a lot of build failed (and terminated) with core:unitTest failure. The failed messages look like this: ``` FAILURE: Build failed with an exception. [2022-09-14T09:51:52.190Z] [2022-09-14T09:51:52.190Z] * What went wrong: [2022-09-14T09:51:52.190Z] Execution failed for task ':core:unitTest'. [2022-09-14T09:51:52.190Z] > Process 'Gradle Test Executor 128' finished with non-zero exit value 1 ``` After investigation, I found one reason of it (maybe there are other reasons). In `BrokerMetadataPublisherTest#testReloadUpdatedFilesWithoutConfigChange` test, we created logManager twice, but when cleanup, we only close one of them. So, there will be a log cleaner keeping running. But during this time, the temp log dirs are deleted, so it will `Exit.halt(1)`, and got the error we saw in gradle, like this code did when we encounter IOException in all our log dirs: ``` fatal(s"Shutdown broker because all log dirs in ${logDirs.mkString(", ")} have failed") Exit.halt(1) ``` Fixed it by disable `_firstPublish` flag for mock publisher, to avoid resource leak. ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) -- 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