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 <[email protected]>
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);

Reply via email to