[ https://issues.apache.org/jira/browse/KAFKA-17189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17868165#comment-17868165 ]
Chia-Ping Tsai commented on KAFKA-17189: ---------------------------------------- It seems`ThreadUtils#shutdownExecutorServiceQuietly` does not wait all threads get updated state. Hence, we will encounter race conditions when calling `Thread.getAllStackTraces()` ... [0] https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/utils/ThreadUtils.java#L71 > Add Thread::isAlive to DetectThreadLeak#of filter > ------------------------------------------------- > > Key: KAFKA-17189 > URL: https://issues.apache.org/jira/browse/KAFKA-17189 > Project: Kafka > Issue Type: Sub-task > Reporter: PoAn Yang > Assignee: PoAn Yang > Priority: Minor > > Although we have KAFKA-17159 to close kafka-cluster-test-kit-executor, we > still have many thread leak when removing `waitForCondition` [0]. > > Adding log to show whether thread is alive when showing "Thread leak > detected" message, I found that detected thread is not alive. We may need to > consider adding `Thread::isAlive` to `DetectThreadLeak#of` filter. > > [0] > [https://ci-builds.apache.org/job/Kafka/job/kafka-pr/job/PR-16661/1/testReport/] > -- This message was sent by Atlassian Jira (v8.20.10#820010)