You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ne...@apache.org on 2023/02/01 07:47:23 UTC

[iotdb] 01/01: fix the ConcurrentModificationException

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

neuyilan pushed a commit to branch bugfix/master_5447
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 1d6f73b750481a2e69cdc7e9cf367a9e4efe462b
Author: HouliangQi <ne...@163.com>
AuthorDate: Wed Feb 1 15:46:41 2023 +0800

    fix the ConcurrentModificationException
---
 .../org/apache/iotdb/db/engine/storagegroup/TsFileManager.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileManager.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileManager.java
index 96d0060c95..032b09aa91 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileManager.java
@@ -86,20 +86,20 @@ public class TsFileManager {
   }
 
   public TsFileResourceList getSequenceListByTimePartition(long timePartition) {
-    readLock();
+    writeLock("getSequenceListByTimePartition");
     try {
       return sequenceFiles.computeIfAbsent(timePartition, l -> new TsFileResourceList());
     } finally {
-      readUnlock();
+      writeUnlock();
     }
   }
 
   public TsFileResourceList getUnsequenceListByTimePartition(long timePartition) {
-    readLock();
+    writeLock("getUnsequenceListByTimePartition");
     try {
       return unsequenceFiles.computeIfAbsent(timePartition, l -> new TsFileResourceList());
     } finally {
-      readUnlock();
+      writeUnlock();
     }
   }