You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2022/12/29 07:05:40 UTC

[iotdb] branch rel/1.0 updated: set isClosed to true after submitting close signal (#8625)

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

xingtanzjr pushed a commit to branch rel/1.0
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/rel/1.0 by this push:
     new 35036fb0c5 set isClosed to true after submitting close signal (#8625)
35036fb0c5 is described below

commit 35036fb0c556a3e12c4b4fc56f1cfd7d60363afb
Author: Alan Choo <43...@users.noreply.github.com>
AuthorDate: Thu Dec 29 15:05:34 2022 +0800

    set isClosed to true after submitting close signal (#8625)
---
 server/src/main/java/org/apache/iotdb/db/wal/buffer/WALBuffer.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/wal/buffer/WALBuffer.java b/server/src/main/java/org/apache/iotdb/db/wal/buffer/WALBuffer.java
index 25ff32c990..c1ef5932e4 100644
--- a/server/src/main/java/org/apache/iotdb/db/wal/buffer/WALBuffer.java
+++ b/server/src/main/java/org/apache/iotdb/db/wal/buffer/WALBuffer.java
@@ -269,6 +269,7 @@ public class WALBuffer extends AbstractWALBuffer {
           if (dataExists) {
             fsyncWorkingBuffer(currentSearchIndex, currentFileStatus, info);
           }
+          isClosed = true;
           return dataExists;
         default:
           return false;
@@ -511,7 +512,6 @@ public class WALBuffer extends AbstractWALBuffer {
 
   @Override
   public void close() {
-    isClosed = true;
     // first waiting serialize and sync tasks finished, then release all resources
     if (serializeThread != null) {
       // add close signal WALEntry to notify serializeThread
@@ -520,6 +520,7 @@ public class WALBuffer extends AbstractWALBuffer {
       } catch (InterruptedException e) {
         logger.error("Fail to put CLOSE_SIGNAL to walEntries.", e);
       }
+      isClosed = true;
       shutdownThread(serializeThread, ThreadName.WAL_SERIALIZE);
     }
     if (syncBufferThread != null) {