Skip to content

Fix intermittent ThreadLeak failures in the concurrent IT tests - #2499

Draft
imotov wants to merge 1 commit into
NVIDIA:mainfrom
imotov:issue-2498-fix-thread-leak-in-test
Draft

Fix intermittent ThreadLeak failures in the concurrent IT tests#2499
imotov wants to merge 1 commit into
NVIDIA:mainfrom
imotov:issue-2498-fix-thread-leak-in-test

Conversation

@imotov

@imotov imotov commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

awaitTermination() returns once the pool reaches TERMINATED, which happens before the workers finish processWorkerExit(), so the threads are still alive and ThreadLeakLingering defaults to no wait, leaving RandomizedRunner to report dying threads as leaks. Annotate CuVSTestCase with @ThreadLeakLingering(linger = 5000), inherited by all four IT classes that create executors. Also make runConcurrently shut the pool down on every path rather than only on success, bound the wait at 60 seconds, keep the pooled-memory reset unconditional, and report a failing task by catching ExecutionException instead of throwing from exceptionally().

Fixes #2498

`awaitTermination()` returns once the pool reaches TERMINATED, which happens before the workers finish `processWorkerExit()`, so the threads are still alive  and `ThreadLeakLingering` defaults to no wait, leaving `RandomizedRunner` to report dying threads as leaks. Annotate `CuVSTestCase` with `@ThreadLeakLingering(linger = 5000)`, inherited by all four IT classes that create executors. Also make `runConcurrently` shut the pool down on every path rather than only on success, bound the wait at 60 seconds, keep the pooled-memory reset unconditional, and report a failing task by catching `ExecutionException` instead of throwing from `exceptionally()`.
@copy-pr-bot

copy-pr-bot Bot commented Aug 22, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@imotov imotov self-assigned this Aug 22, 2026
@imotov imotov added bug Something isn't working non-breaking Introduces a non-breaking change testing labels Aug 22, 2026
@imotov

imotov commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 9c5c2fe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working non-breaking Introduces a non-breaking change testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG][Java] Intermittent ThreadLeak in CagraBuildAndSearchIT: awaitTermination returns before worker threads exit

1 participant