Skip to content

Commit

Permalink
Ignore the default ForkJoinPool's system threads in thread leak detec…
Browse files Browse the repository at this point in the history
…tion #14066
  • Loading branch information
dweiss committed Dec 14, 2024
1 parent 05fa38f commit 98cef89
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import com.carrotsearch.randomizedtesting.ThreadFilter;
import org.apache.lucene.util.Constants;

import java.util.concurrent.ForkJoinWorkerThread;

/** Last minute patches. */
public class QuickPatchThreadsFilter implements ThreadFilter {
static final boolean isJ9;
Expand All @@ -42,6 +44,15 @@ public boolean reject(Thread t) {
return true;
}
}

if (t instanceof ForkJoinWorkerThread
&& t.getName().startsWith("ForkJoinPool.commonPool-worker")
&& t.isDaemon()) {
// GH-14066: filter out common pool's worker threads. Assume they have completed
// all background tasks and are idle.
return true;
}

return false;
}
}

0 comments on commit 98cef89

Please sign in to comment.