This is an automated email from the ASF dual-hosted git repository. xiangweiwei pushed a commit to branch throwable in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 6c56db2ea4bec248ac5e655d314f9b70b0208f3c Author: Alima777 <[email protected]> AuthorDate: Thu Nov 25 15:22:01 2021 +0800 catch throwable in sub query threads --- .../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; } }
