gaurav-narula opened a new pull request, #15996:
URL: https://github.com/apache/kafka/pull/15996

   An exception thrown while closing the client instances in 
`IntegrationTestHarness::tearDown` may result in
   `KafkaServerTestHarness::tearDown` not being invoked. This would result in 
thread leaks of the broker and controller threads spawned in the failing test.
   
   An example of this is the [CI
   
run](https://ci-builds.apache.org/blue/organizations/jenkins/Kafka%2Fkafka-pr/detail/PR-15994/1/tests)
 for #15994 where
   `Build / JDK 8 and Scala 2.12 / testCoordinatorFailover(String, 
String).quorum=kraft+kip848.groupProtocol=consumer – 
kafka.api.PlaintextConsumerTest` failing results in 
`consumers.foreach(_.close(Duration.ZERO))` in 
`IntegrationTestHarness::tearDown` throwing an exception.
   
   A side effect of this is it poisons Gradle test runner JVM and prevents 
tests in other unrelated classes from executing as `@BeforeAll` check in 
QuorumTestHarness would cause them to fail immediately.
   
   This PR encloses the client closure in try-finally to ensure 
`KafkaServerTestHarness::tearDown` is always invoked.
   
   ### 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

Reply via email to