You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ji...@apache.org on 2020/01/14 04:34:16 UTC

[incubator-iotdb] branch fix_420 created (now 1f5d4e5)

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

jiangtian pushed a change to branch fix_420
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.


      at 1f5d4e5   avoid encoding task dying silently

This branch includes the following new commits:

     new 1f5d4e5   avoid encoding task dying silently

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[incubator-iotdb] 01/01: avoid encoding task dying silently

Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jiangtian pushed a commit to branch fix_420
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git

commit 1f5d4e51d5af59db71ae28f26e0373f5ed3894c5
Author: jt2594838 <jt...@163.com>
AuthorDate: Tue Jan 14 12:33:42 2020 +0800

     avoid encoding task dying silently
---
 .../org/apache/iotdb/db/engine/flush/MemTableFlushTask.java  | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/engine/flush/MemTableFlushTask.java b/server/src/main/java/org/apache/iotdb/db/engine/flush/MemTableFlushTask.java
index 9c20ab5..09d63c2 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/flush/MemTableFlushTask.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/flush/MemTableFlushTask.java
@@ -43,6 +43,7 @@ public class MemTableFlushTask {
   private static final Logger logger = LoggerFactory.getLogger(MemTableFlushTask.class);
   private static final FlushSubTaskPoolManager subTaskPoolManager = FlushSubTaskPoolManager
       .getInstance();
+  private Future encodingTaskFuture;
   private Future ioTaskFuture;
   private RestorableTsFileIOWriter writer;
 
@@ -61,7 +62,7 @@ public class MemTableFlushTask {
     this.schema = schema;
     this.writer = writer;
     this.storageGroup = storageGroup;
-    subTaskPoolManager.submit(encodingTask);
+    this.encodingTaskFuture = subTaskPoolManager.submit(encodingTask);
     this.ioTaskFuture = subTaskPoolManager.submit(ioTask);
     logger.debug("flush task of Storage group {} memtable {} is created ",
         storageGroup, memTable.getVersion());
@@ -94,6 +95,15 @@ public class MemTableFlushTask {
         "Storage group {} memtable {}, flushing into disk: data sort time cost {} ms.",
         storageGroup, memTable.getVersion(), sortTime);
 
+    try {
+      encodingTaskFuture.get();
+    } catch (InterruptedException | ExecutionException e) {
+      // avoid ioTask waiting forever
+      noMoreIOTask = true;
+      ioTaskFuture.cancel(true);
+      throw e;
+    }
+
     ioTaskFuture.get();
 
     logger.info(