You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2022/04/20 03:16:36 UTC
[iotdb] 01/01: add Thread re-interrupt when catching exception
This is an automated email from the ASF dual-hosted git repository.
xingtanzjr pushed a commit to branch xingtanzjr/fix-sonar
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 14ad747a1220bfe447d730a245f7520493b009be
Author: Jinrui.Zhang <xi...@gmail.com>
AuthorDate: Wed Apr 20 11:16:20 2022 +0800
add Thread re-interrupt when catching exception
---
.../java/org/apache/iotdb/db/mpp/execution/config/ConfigExecution.java | 1 +
.../org/apache/iotdb/db/mpp/execution/scheduler/ClusterScheduler.java | 1 +
2 files changed, 2 insertions(+)
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/config/ConfigExecution.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/config/ConfigExecution.java
index b134d4896b..fe63991dfc 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/config/ConfigExecution.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/config/ConfigExecution.java
@@ -91,6 +91,7 @@ public class ConfigExecution implements IQueryExecution {
},
executor);
} catch (Throwable e) {
+ Thread.currentThread().interrupt();
fail(e);
}
}
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/scheduler/ClusterScheduler.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/scheduler/ClusterScheduler.java
index 7fa8d3c0b6..18c9b47367 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/scheduler/ClusterScheduler.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/scheduler/ClusterScheduler.java
@@ -96,6 +96,7 @@ public class ClusterScheduler implements IScheduler {
}
} catch (InterruptedException | ExecutionException e) {
// If the dispatch failed, we make the QueryState as failed, and return.
+ Thread.currentThread().interrupt();
stateMachine.transitionToFailed(e);
return;
}