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 2020/11/05 14:32:13 UTC

[iotdb] branch test_travis created (now e2ee9ee)

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

hxd pushed a change to branch test_travis
in repository https://gitbox.apache.org/repos/asf/iotdb.git.


      at e2ee9ee  add wait time for stoping StorageEngine

This branch includes the following new commits:

     new e2ee9ee  add wait time for stoping StorageEngine

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.



[iotdb] 01/01: add wait time for stoping StorageEngine

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

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

commit e2ee9eeaf231ba05fd05b76bbeb74828799e7030
Author: xiangdong huang <sa...@gmail.com>
AuthorDate: Thu Nov 5 22:31:42 2020 +0800

    add wait time for stoping StorageEngine
---
 .../java/org/apache/iotdb/db/engine/StorageEngine.java    | 15 ++++++++++++---
 server/src/test/resources/logback.xml                     |  1 +
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java b/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
index b6d5ace..1c3284c 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
@@ -264,16 +264,25 @@ public class StorageEngine implements IService {
     if (ttlCheckThread != null) {
       ttlCheckThread.shutdownNow();
       try {
-        ttlCheckThread.awaitTermination(30, TimeUnit.SECONDS);
+        ttlCheckThread.awaitTermination(60, TimeUnit.SECONDS);
       } catch (InterruptedException e) {
-        logger.warn("TTL check thread still doesn't exit after 30s");
+        logger.warn("TTL check thread still doesn't exit after 60s");
         Thread.currentThread().interrupt();
-        throw new StorageEngineFailureException("StorageEngine failed to stop.", e);
+        throw new StorageEngineFailureException("StorageEngine failed to stop because of "
+            + "ttlCheckThread.", e);
       }
     }
     recoveryThreadPool.shutdownNow();
     if (!recoverAllSgThreadPool.isShutdown()) {
       recoverAllSgThreadPool.shutdownNow();
+      try {
+        recoverAllSgThreadPool.awaitTermination(60, TimeUnit.SECONDS);
+      } catch (InterruptedException e) {
+        logger.warn("recoverAllSgThreadPool thread still doesn't exit after 60s");
+        Thread.currentThread().interrupt();
+        throw new StorageEngineFailureException("StorageEngine failed to stop because of "
+            + "recoverAllSgThreadPool.", e);
+      }
     }
     this.reset();
   }
diff --git a/server/src/test/resources/logback.xml b/server/src/test/resources/logback.xml
index a1c1c44..687a3a2 100644
--- a/server/src/test/resources/logback.xml
+++ b/server/src/test/resources/logback.xml
@@ -45,6 +45,7 @@
     <logger name="org.apache.iotdb.db.service.MetricsService" level="INFO"/>
     <logger name="org.apache.iotdb.db.engine.flush.FlushManager" level="INFO"/>
     <logger name="org.apache.iotdb.db.integration.IoTDBMergeTest" level="INFO"/>
+    <logger name="org.apache.iotdb.db.service.RegisterManager" level="INFO"/>
     <logger name="org.apache.iotdb.db.service.IoTDB" level="INFO"/>
     <logger name="org.apache.iotdb.db.service.RPCService" level="INFO"/>
     <logger name="org.apache.iotdb.db.service.MQTTService" level="INFO"/>