You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2022/09/08 08:56:26 UTC

[iotdb] 01/01: Add if to avoid assertTrue error

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

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

commit 5b3350a2fd309c1fc0e55a9e26f6feff70d4946c
Author: JackieTien97 <ja...@gmail.com>
AuthorDate: Thu Sep 8 16:52:04 2022 +0800

    Add if to avoid assertTrue error
---
 .../java/org/apache/iotdb/db/mpp/execution/exchange/SinkHandle.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/SinkHandle.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/SinkHandle.java
index 8d58327bed..703a04d760 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/SinkHandle.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/SinkHandle.java
@@ -313,7 +313,11 @@ public class SinkHandle implements ISinkHandle {
     if (isFinished()) {
       sinkHandleListener.onFinish(this);
     }
-    localMemoryManager.getQueryPool().free(localFragmentInstanceId.getQueryId(), freedBytes);
+    // there may exist duplicate ack message in network caused by caller retrying, if so duplicate
+    // ack message's freedBytes may be zero
+    if (freedBytes > 0) {
+      localMemoryManager.getQueryPool().free(localFragmentInstanceId.getQueryId(), freedBytes);
+    }
   }
 
   public TEndPoint getRemoteEndpoint() {