This is an automated email from the ASF dual-hosted git repository.
yuzelin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new b0a3b87ee [core] Fix cache thread pool in FileDeletionThreadPool
(#3767)
b0a3b87ee is described below
commit b0a3b87ee35c338d3b8311247323aba027aaa6d1
Author: Jingsong Lee <[email protected]>
AuthorDate: Wed Jul 17 15:36:55 2024 +0800
[core] Fix cache thread pool in FileDeletionThreadPool (#3767)
---
.../org/apache/paimon/utils/FileDeletionThreadPool.java | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git
a/paimon-common/src/main/java/org/apache/paimon/utils/FileDeletionThreadPool.java
b/paimon-common/src/main/java/org/apache/paimon/utils/FileDeletionThreadPool.java
index 51b208930..07b0f5d32 100644
---
a/paimon-common/src/main/java/org/apache/paimon/utils/FileDeletionThreadPool.java
+++
b/paimon-common/src/main/java/org/apache/paimon/utils/FileDeletionThreadPool.java
@@ -44,12 +44,15 @@ public class FileDeletionThreadPool {
}
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;
}
}