You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2021/11/25 13:54:01 UTC
[iotdb] branch master updated: catch throwable in sub query threads (#4462)
This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 2424f73 catch throwable in sub query threads (#4462)
2424f73 is described below
commit 2424f739360ae3eea1984ccfd25a89937c98b7aa
Author: Xiangwei Wei <34...@users.noreply.github.com>
AuthorDate: Thu Nov 25 21:53:29 2021 +0800
catch throwable in sub query threads (#4462)
---
.../query/dataset/RawQueryDataSetWithoutValueFilter.java | 14 +++++++-------
.../iotdb/tsfile/read/common/ExceptionBatchData.java | 10 +++++-----
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/query/dataset/RawQueryDataSetWithoutValueFilter.java b/server/src/main/java/org/apache/iotdb/db/query/dataset/RawQueryDataSetWithoutValueFilter.java
index 806321f..5f83c74 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/dataset/RawQueryDataSetWithoutValueFilter.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/dataset/RawQueryDataSetWithoutValueFilter.java
@@ -116,12 +116,12 @@ public class RawQueryDataSetWithoutValueFilter extends QueryDataSet
e,
String.format(
"Something gets wrong while reading from the series reader %s: ", pathName));
- } catch (Exception e) {
+ } catch (Throwable e) {
putExceptionBatchData(e, "Something gets wrong: ");
}
}
- private void putExceptionBatchData(Exception e, String logMessage) {
+ private void putExceptionBatchData(Throwable e, String logMessage) {
try {
LOGGER.error(logMessage, e);
reader.setHasRemaining(false);
@@ -517,11 +517,11 @@ public class RawQueryDataSetWithoutValueFilter extends QueryDataSet
} else if (batchData instanceof ExceptionBatchData) {
// exception happened in producer thread
ExceptionBatchData exceptionBatchData = (ExceptionBatchData) batchData;
- LOGGER.error("exception happened in producer thread", exceptionBatchData.getException());
- if (exceptionBatchData.getException() instanceof IOException) {
- throw (IOException) exceptionBatchData.getException();
- } else if (exceptionBatchData.getException() instanceof RuntimeException) {
- throw (RuntimeException) exceptionBatchData.getException();
+ LOGGER.error("exception happened in producer thread", exceptionBatchData.getThrowable());
+ if (exceptionBatchData.getThrowable() instanceof IOException) {
+ throw (IOException) exceptionBatchData.getThrowable();
+ } else if (exceptionBatchData.getThrowable() instanceof RuntimeException) {
+ throw (RuntimeException) exceptionBatchData.getThrowable();
}
} else { // there are more batch data in this time series queue
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/common/ExceptionBatchData.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/common/ExceptionBatchData.java
index d71d39b..b26284b 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/read/common/ExceptionBatchData.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/read/common/ExceptionBatchData.java
@@ -20,10 +20,10 @@ package org.apache.iotdb.tsfile.read.common;
public class ExceptionBatchData extends BatchData {
- private Exception exception;
+ private Throwable throwable;
- public ExceptionBatchData(Exception exception) {
- this.exception = exception;
+ public ExceptionBatchData(Throwable throwable) {
+ this.throwable = throwable;
}
@Override
@@ -31,7 +31,7 @@ public class ExceptionBatchData extends BatchData {
throw new UnsupportedOperationException("hasCurrent is not supported for ExceptionBatchData");
}
- public Exception getException() {
- return exception;
+ public Throwable getThrowable() {
+ return throwable;
}
}