Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KAFKA-16789: Fix thread leak detection for event handler threads #15984

Merged
merged 2 commits into from
May 19, 2024

Conversation

gaurav-narula
Copy link
Contributor

Updates TestUtils::verifyNoUnexpectedThreads to check for all event queue threads instead of the incorrect QuorumController thread.

Also updated KafkaEventQueueTest to use try-with-resources to ensure threads get closed and to use LoggerContext with the current test name as the logPrefix for easier debugging.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

Updates `TestUtils::verifyNoUnexpectedThreads` to check for all
event queue threads instead of the incorrect QuorumController thread.

Also updated `KafkaEventQueueTest` to use try-with-resources to ensure
threads get closed and to use LoggerContext with the current test name
as the logPrefix for easier debugging.
Copy link
Contributor

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaurav-narula nice patch!

@@ -1872,7 +1872,7 @@ object TestUtils extends Logging {
AdminClientUnitTestEnv.kafkaAdminClientNetworkThreadPrefix(),
AbstractCoordinator.HEARTBEAT_THREAD_PREFIX,
QuorumTestHarness.ZkClientEventThreadSuffix,
QuorumController.CONTROLLER_THREAD_SUFFIX,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems CONTROLLER_THREAD_SUFFIX can be removed from QuorumController

@chia7712
Copy link
Contributor

I will merge this PR after QA gets work.

@chia7712 chia7712 merged commit 412b05d into apache:trunk May 19, 2024
1 check failed
rreddy-22 pushed a commit to rreddy-22/kafka-rreddy that referenced this pull request May 24, 2024
TaiJuWu pushed a commit to TaiJuWu/kafka that referenced this pull request Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants