You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by zy...@apache.org on 2023/03/02 10:54:26 UTC

[iotdb] branch master updated: Fix timeout in Schema UT (#9195)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 9f2b526c61 Fix timeout in Schema UT (#9195)
9f2b526c61 is described below

commit 9f2b526c616a34a48c1222c02b2b12ce994c49bf
Author: Chen YZ <43...@users.noreply.github.com>
AuthorDate: Thu Mar 2 18:54:19 2023 +0800

    Fix timeout in Schema UT (#9195)
---
 .../db/metadata/mtree/store/disk/cache/CacheMemoryManager.java    | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/mtree/store/disk/cache/CacheMemoryManager.java b/server/src/main/java/org/apache/iotdb/db/metadata/mtree/store/disk/cache/CacheMemoryManager.java
index 1fdd34e6c2..039465f6c1 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/mtree/store/disk/cache/CacheMemoryManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/mtree/store/disk/cache/CacheMemoryManager.java
@@ -117,6 +117,7 @@ public class CacheMemoryManager {
                   tryExecuteMemoryRelease();
                 }
               } catch (Throwable throwable) {
+                hasReleaseTask = false;
                 logger.error("Something wrong happened during MTree release.", throwable);
               }
             }
@@ -135,6 +136,7 @@ public class CacheMemoryManager {
                   tryFlushVolatileNodes();
                 }
               } catch (Throwable throwable) {
+                hasFlushTask = false;
                 logger.error("Something wrong happened during MTree flush.", throwable);
               }
             }
@@ -279,10 +281,16 @@ public class CacheMemoryManager {
   public void clear() {
     if (releaseTaskMonitor != null) {
       releaseTaskMonitor.shutdownNow();
+      while (true) {
+        if (releaseTaskMonitor.isTerminated()) break;
+      }
       releaseTaskMonitor = null;
     }
     if (flushTaskMonitor != null) {
       flushTaskMonitor.shutdownNow();
+      while (true) {
+        if (flushTaskMonitor.isTerminated()) break;
+      }
       releaseTaskMonitor = null;
     }
     if (releaseTaskProcessor != null) {