kafka
kafka copied to clipboard
MINOR: Stop leaking threads in BlockingConnectorTest
These tests currently create threads that block forever until the JVM is shut down. This change unblocks those threads once their respective test cases are finished.
This is valuable not only for general code hygiene and resource utilization, but also for laying the groundwork for reusing an embedded Connect cluster across each of these test cases, which would drastically reduce test time. That's left for a follow-up PR, though.
Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
@kkonstantine can you please review this?
@ijuma it appears that @kkonstantine is busy at the moment.
@cadonna would you be willing to take a look, since you were previously in the neighborhood? This change is much less involved but touches on the same BlockingConnectorTest
suite.
@C0urante It's a bit difficult to review since there is no explanation on what each latch does. If you add some explanatory comments to the code, I can try to review it.
Thanks @ijuma, I've updated the PR with some more details on the purpose of each latch type, and addressed a small bug that would have caused connectors/tasks to become unblocked incorrectly during testing.
@tombentley @viktorsomogyi if you have a moment, would you mind taking a look? Thanks!