kafka icon indicating copy to clipboard operation
kafka copied to clipboard

MINOR: Stop leaking threads in BlockingConnectorTest

Open C0urante opened this issue 2 years ago • 4 comments

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)

C0urante avatar Jun 14 '22 01:06 C0urante

@kkonstantine can you please review this?

ijuma avatar Jun 15 '22 16:06 ijuma

@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 avatar Jun 28 '22 22:06 C0urante

@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.

ijuma avatar Aug 10 '22 13:08 ijuma

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.

C0urante avatar Aug 16 '22 16:08 C0urante

@tombentley @viktorsomogyi if you have a moment, would you mind taking a look? Thanks!

C0urante avatar Jun 06 '23 17:06 C0urante