You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ib...@apache.org on 2020/07/07 14:57:22 UTC
[accumulo] 06/09: re #1621: Increased the thread pool timeout.
This is an automated email from the ASF dual-hosted git repository.
ibella pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git
commit b643edcd7770be9c7ca2416287575ffdfd196cfb
Author: Ivan Bella <iv...@bella.name>
AuthorDate: Tue Jun 23 11:50:15 2020 -0400
re #1621: Increased the thread pool timeout.
---
.../main/java/org/apache/accumulo/core/util/SimpleThreadPool.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/core/src/main/java/org/apache/accumulo/core/util/SimpleThreadPool.java b/core/src/main/java/org/apache/accumulo/core/util/SimpleThreadPool.java
index 34f8359..a7888b9 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/SimpleThreadPool.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/SimpleThreadPool.java
@@ -28,15 +28,19 @@ import java.util.concurrent.TimeUnit;
*/
public class SimpleThreadPool extends ThreadPoolExecutor {
+ // the number of seconds before we allow a thread to terminate with non-use.
+ private static long TIMEOUT_SECS = 180L;
+
public SimpleThreadPool(int coreAndMax, boolean allowCoreThreadTimeOut, final String name) {
- super(coreAndMax, coreAndMax, 4L, TimeUnit.SECONDS, new LinkedBlockingQueue<>(),
+ super(coreAndMax, coreAndMax, TIMEOUT_SECS, TimeUnit.SECONDS, new LinkedBlockingQueue<>(),
new NamingThreadFactory(name));
allowCoreThreadTimeOut(allowCoreThreadTimeOut);
}
public SimpleThreadPool(int coreAndMax, boolean allowCoreThreadTimeOut, final String name,
BlockingQueue<Runnable> queue) {
- super(coreAndMax, coreAndMax, 4L, TimeUnit.SECONDS, queue, new NamingThreadFactory(name));
+ super(coreAndMax, coreAndMax, TIMEOUT_SECS, TimeUnit.SECONDS, queue,
+ new NamingThreadFactory(name));
allowCoreThreadTimeOut(allowCoreThreadTimeOut);
}