unknowntpo opened a new pull request, #22827:
URL: https://github.com/apache/kafka/pull/22827

   ## Summary
   
   - skip detected threads that terminate before the thread-leak report is built
   - add a regression test covering the terminated-thread race
   
   ## Motivation
   
   `ClusterTestExtensions#afterEach` formats detected threads with 
`Thread#getThreadGroup().getName()`. A thread can terminate after 
`DetectThreadLeak#newThreads()` captures it but before the message is 
formatted. Since `Thread#getThreadGroup()` returns `null` for a terminated 
thread, the reporting path throws an NPE even though the thread is no longer a 
leak.
   
   CI failure: 
https://github.com/apache/kafka/actions/runs/29228499012/job/86748625389#step:6:136310
   
   Jira: https://issues.apache.org/jira/browse/KAFKA-20802
   
   Related: https://issues.apache.org/jira/browse/KAFKA-17189
   
   ## Testing
   
   - `./gradlew :test-common:test-common-runtime:test --tests 
org.apache.kafka.common.test.junit.ClusterTestExtensionsUnitTest`
   - `./gradlew :test-common:test-common-runtime:spotlessCheck`
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to