Skip to content

KAFKA-18501: Fix thread leak issue in ClientQuotasRequestTest #19921

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

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

kumarlokesh
Copy link
Contributor

Fixes https://issues.apache.org/jira/browse/KAFKA-18501

  1. It seems the ClientQuotasRequestTest was leaking threads due to unclosed
    Admin client instances. This was causing flaky tests.
  2. Added a thread-safe collection to track all created Admin clients.
  3. Updated all test methods to use the new createAdminClient() method
    instead of directly creating Admin clients.

@github-actions github-actions bot added triage PRs from the community core Kafka Broker tests Test fixes (including flaky tests) small Small PRs labels Jun 7, 2025
@@ -168,7 +189,7 @@ class ClientQuotasRequestTest(cluster: ClusterInstance) {
def testClientQuotasForScramUsers(): Unit = {
val userName = "user"

val admin = cluster.admin()
val admin = createAdminClient()
Copy link
Member

Choose a reason for hiding this comment

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

this admin is released in the final block, so I'm not sure if it is indeed the root cause :_

Also, this test case is disabled so does it cause the thread leak?

@github-actions github-actions bot removed the triage PRs from the community label Jun 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Kafka Broker small Small PRs tests Test fixes (including flaky tests)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants