You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by er...@apache.org on 2023/01/04 06:15:00 UTC

[iotdb] branch bugfix/robost-exit created (now 0bbf4b31b9)

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

ericpai pushed a change to branch bugfix/robost-exit
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at 0bbf4b31b9 Make subprocesses' exit under control in IT cases

This branch includes the following new commits:

     new 0bbf4b31b9 Make subprocesses' exit under control in IT cases

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: Make subprocesses' exit under control in IT cases

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

ericpai pushed a commit to branch bugfix/robost-exit
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 0bbf4b31b979ec5984f045a8036e9779b4e0d4b2
Author: ericpai <er...@hotmail.com>
AuthorDate: Wed Jan 4 14:14:45 2023 +0800

    Make subprocesses' exit under control in IT cases
---
 .../java/org/apache/iotdb/it/env/AbstractNodeWrapper.java   | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/AbstractNodeWrapper.java b/integration-test/src/main/java/org/apache/iotdb/it/env/AbstractNodeWrapper.java
index 2ce9384941..2ab646160a 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/AbstractNodeWrapper.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/AbstractNodeWrapper.java
@@ -208,12 +208,15 @@ public abstract class AbstractNodeWrapper implements BaseNodeWrapper {
 
   @Override
   public void waitingToShutDown() {
-    while (this.instance != null && this.instance.isAlive()) {
-      try {
-        Thread.sleep(100);
-      } catch (InterruptedException e) {
-        logger.error("Waiting node to shutdown." + e);
+    if (this.instance == null) {
+      return;
+    }
+    try {
+      if (!this.instance.waitFor(20, TimeUnit.SECONDS)) {
+        this.instance.destroyForcibly().waitFor(10, TimeUnit.SECONDS);
       }
+    } catch (InterruptedException e) {
+      logger.error("Waiting node to shutdown error." + e);
     }
   }