You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2020/12/02 11:51:09 UTC

[iotdb] branch master updated: Fix File Not Found when serializing TsFileResources (#2161)

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

qiaojialin 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 8e8384f  Fix File Not Found when serializing TsFileResources (#2161)
8e8384f is described below

commit 8e8384f43dcab8e45cd25723bcf292c2392bb5df
Author: SilverNarcissus <15...@smail.nju.edu.cn>
AuthorDate: Wed Dec 2 19:50:56 2020 +0800

    Fix File Not Found when serializing TsFileResources (#2161)
---
 .../java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java
index 58f37b3..2221ae4 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java
@@ -265,7 +265,7 @@ public class TsFileResource {
     Arrays.fill(times, defaultTime);
   }
 
-  public void serialize() throws IOException {
+  public synchronized void serialize() throws IOException {
     try (OutputStream outputStream = fsFactory.getBufferedOutputStream(
         file + RESOURCE_SUFFIX + TEMP_SUFFIX)) {
       ReadWriteIOUtils.write(this.deviceToIndex.size(), outputStream);