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 2021/07/03 09:54:48 UTC

[iotdb] branch rel/0.12 updated: fix take byte array null pointer (#3497)

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

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


The following commit(s) were added to refs/heads/rel/0.12 by this push:
     new 68e8801  fix take byte array null pointer (#3497)
68e8801 is described below

commit 68e8801b1bdc4c328a4e4e8b27b287892f215ad3
Author: Jialin Qiao <qj...@mails.tsinghua.edu.cn>
AuthorDate: Sat Jul 3 04:54:25 2021 -0500

    fix take byte array null pointer (#3497)
---
 .../main/java/org/apache/iotdb/cluster/utils/PlanSerializer.java  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/utils/PlanSerializer.java b/cluster/src/main/java/org/apache/iotdb/cluster/utils/PlanSerializer.java
index 71b3136..78200f0 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/utils/PlanSerializer.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/utils/PlanSerializer.java
@@ -35,7 +35,13 @@ public class PlanSerializer {
   }
 
   public byte[] serialize(PhysicalPlan plan) throws IOException {
-    ByteArrayOutputStream poll = baosBlockingDeque.poll();
+    ByteArrayOutputStream poll;
+    try {
+      poll = baosBlockingDeque.take();
+    } catch (InterruptedException e) {
+      Thread.currentThread().interrupt();
+      throw new IOException("take byte array output stream interrupted", e);
+    }
     poll.reset();
 
     try (DataOutputStream dataOutputStream = new DataOutputStream(poll)) {