You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2022/08/25 06:42:38 UTC

[iotdb] 01/01: Fix deadlock in cancel query and timeout detect thread

This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch IOTDB-4235
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 85ec3259a5c8f4f01695b1709fa81e17326c02b4
Author: JackieTien97 <ja...@gmail.com>
AuthorDate: Thu Aug 25 14:41:44 2022 +0800

    Fix deadlock in cancel query and timeout detect thread
---
 .../apache/iotdb/db/mpp/execution/schedule/DriverTaskThread.java   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/schedule/DriverTaskThread.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/schedule/DriverTaskThread.java
index f49806ac31..e56560d0ac 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/schedule/DriverTaskThread.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/schedule/DriverTaskThread.java
@@ -18,6 +18,7 @@
  */
 package org.apache.iotdb.db.mpp.execution.schedule;
 
+import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory;
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
 import org.apache.iotdb.db.mpp.execution.driver.IDriver;
 import org.apache.iotdb.db.mpp.execution.schedule.queue.IndexedBlockingQueue;
@@ -25,7 +26,6 @@ import org.apache.iotdb.db.mpp.execution.schedule.task.DriverTask;
 import org.apache.iotdb.db.utils.stats.CpuTimer;
 
 import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.MoreExecutors;
 import io.airlift.concurrent.SetThreadName;
 import io.airlift.units.Duration;
 
@@ -40,8 +40,9 @@ public class DriverTaskThread extends AbstractDriverThread {
           IoTDBDescriptor.getInstance().getConfig().getDriverTaskExecutionTimeSliceInMs(),
           TimeUnit.MILLISECONDS);
 
-  // As the callback is lightweight enough, there's no need to use another one thread to execute.
-  private static final Executor listeningExecutor = MoreExecutors.directExecutor();
+  // we manage thread pool size directly, so create an unlimited pool
+  private static final Executor listeningExecutor =
+      IoTDBThreadPoolFactory.newCachedThreadPool("scheduler-notification");
 
   public DriverTaskThread(
       String workerId,