Skip to content

Commit

Permalink
[core] Fix cache thread pool in FileDeletionThreadPool (apache#3767)
Browse files Browse the repository at this point in the history
  • Loading branch information
JingsongLi authored Jul 17, 2024
1 parent f349615 commit b0a3b87
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@ public static synchronized ThreadPoolExecutor getExecutorService(int threadNum)
}

private static ThreadPoolExecutor createCachedThreadPool(int threadNum) {
return new ThreadPoolExecutor(
0,
threadNum,
1,
TimeUnit.MINUTES,
new LinkedBlockingQueue<>(),
newDaemonThreadFactory("DELETE-FILE-THREAD-POOL"));
ThreadPoolExecutor executor =
new ThreadPoolExecutor(
threadNum,
threadNum,
1,
TimeUnit.MINUTES,
new LinkedBlockingQueue<>(),
newDaemonThreadFactory("DELETE-FILE-THREAD-POOL"));
executor.allowCoreThreadTimeOut(true);
return executor;
}
}

0 comments on commit b0a3b87

Please sign in to comment.