You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2019/04/12 08:41:52 UTC

[incubator-iotdb] branch fix_future_lost_when_flush_multitimes updated: throw exception when flushing failed

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

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


The following commit(s) were added to refs/heads/fix_future_lost_when_flush_multitimes by this push:
     new 1b511f8  throw exception when flushing failed
1b511f8 is described below

commit 1b511f8a5785c3bdd6c82cee301cff9c8919b34d
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Fri Apr 12 16:41:42 2019 +0800

    throw exception when flushing failed
---
 .../apache/iotdb/db/engine/bufferwrite/BufferWriteProcessor.java   | 2 +-
 .../org/apache/iotdb/db/engine/overflow/io/OverflowProcessor.java  | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessor.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessor.java
index 51c7907..d30eec5 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessor.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessor.java
@@ -339,7 +339,7 @@ public class BufferWriteProcessor extends Processor {
       LOGGER.error("Encounter an interrupt error when waitting for the flushing, "
               + "the bufferwrite processor is {}.",
           getProcessorName(), e);
-      Thread.currentThread().interrupt();
+      throw new IOException(e);
     }
     if (valueCount > 0) {
       // update the lastUpdatetime, prepare for flush
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowProcessor.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowProcessor.java
index a3a4663..16a7ae1 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowProcessor.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowProcessor.java
@@ -475,7 +475,7 @@ public class OverflowProcessor extends Processor {
   @Override
   public synchronized Future<Boolean> flush() throws IOException {
     // statistic information for flush
-    if (lastFlushTime > 0) {
+    if (lastFlushTime > 0 && LOGGER.isInfoEnabled()) {
       long thisFLushTime = System.currentTimeMillis();
       ZonedDateTime lastDateTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(lastFlushTime),
           IoTDBDescriptor.getInstance().getConfig().getZoneID());
@@ -492,9 +492,8 @@ public class OverflowProcessor extends Processor {
       flushFuture.get();
     } catch (InterruptedException | ExecutionException e) {
       LOGGER.error("Encounter an interrupt error when waitting for the flushing, "
-              + "the bufferwrite processor is {}.",
-          getProcessorName(), e);
-      Thread.currentThread().interrupt();
+              + "the bufferwrite processor is {}.", getProcessorName(), e);
+      throw new IOException(e);
     }
     if (valueCount > 0) {
       try {