hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ayushsax...@apache.org
Subject [hadoop] branch trunk updated: HDFS-15373. Fix number of threads in IPCLoggerChannel#createParallelExecutor. Contributed by Ayush Saxena.
Date Tue, 26 May 2020 11:01:18 GMT
This is an automated email from the ASF dual-hosted git repository.

ayushsaxena pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 6c9f75c  HDFS-15373. Fix number of threads in IPCLoggerChannel#createParallelExecutor.
Contributed by Ayush Saxena.
6c9f75c is described below

commit 6c9f75cf16b4a321a3b6965b76c53033843ce178
Author: Ayush Saxena <ayushsaxena@apache.org>
AuthorDate: Tue May 26 16:26:57 2020 +0530

    HDFS-15373. Fix number of threads in IPCLoggerChannel#createParallelExecutor. Contributed
by Ayush Saxena.
---
 .../org/apache/hadoop/hdfs/qjournal/client/IPCLoggerChannel.java     | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/IPCLoggerChannel.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/IPCLoggerChannel.java
index 3b3f89e..07c8955 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/IPCLoggerChannel.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/IPCLoggerChannel.java
@@ -275,12 +275,15 @@ public class IPCLoggerChannel implements AsyncLogger {
     int numThreads =
         conf.getInt(DFSConfigKeys.DFS_QJOURNAL_PARALLEL_READ_NUM_THREADS_KEY,
             DFSConfigKeys.DFS_QJOURNAL_PARALLEL_READ_NUM_THREADS_DEFAULT);
-    return new ThreadPoolExecutor(1, numThreads, 60L, TimeUnit.SECONDS,
+    ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(numThreads,
+        numThreads, 60L, TimeUnit.SECONDS,
         new LinkedBlockingQueue<>(),
         new ThreadFactoryBuilder().setDaemon(true)
             .setNameFormat("Logger channel (from parallel executor) to " + addr)
             .setUncaughtExceptionHandler(UncaughtExceptionHandlers.systemExit())
             .build());
+    threadPoolExecutor.allowCoreThreadTimeOut(true);
+    return threadPoolExecutor;
   }
   
   @Override


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message