drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prog...@apache.org
Subject drill git commit: DRILL-5749: solve deadlock occured between foreman and netty threads
Date Sun, 17 Sep 2017 21:15:41 GMT
Repository: drill
Updated Branches:
  refs/heads/master 75bd1d04b -> 1c20a323f


DRILL-5749: solve deadlock occured between foreman and netty threads

closes #943


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/1c20a323
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/1c20a323
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/1c20a323

Branch: refs/heads/master
Commit: 1c20a323f3941e1b4790332247ca1fe26e960477
Parents: 75bd1d0
Author: weijie.tong <weijie.tong@alipay.com>
Authored: Thu Sep 14 20:02:55 2017 +0800
Committer: Paul Rogers <progers@maprtech.com>
Committed: Sat Sep 16 23:33:35 2017 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/drill/exec/rpc/RequestIdMap.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/1c20a323/exec/rpc/src/main/java/org/apache/drill/exec/rpc/RequestIdMap.java
----------------------------------------------------------------------
diff --git a/exec/rpc/src/main/java/org/apache/drill/exec/rpc/RequestIdMap.java b/exec/rpc/src/main/java/org/apache/drill/exec/rpc/RequestIdMap.java
index 804834c..e286beb 100644
--- a/exec/rpc/src/main/java/org/apache/drill/exec/rpc/RequestIdMap.java
+++ b/exec/rpc/src/main/java/org/apache/drill/exec/rpc/RequestIdMap.java
@@ -17,9 +17,6 @@
  */
 package org.apache.drill.exec.rpc;
 
-import io.netty.buffer.ByteBuf;
-import io.netty.channel.ChannelFuture;
-
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -30,6 +27,9 @@ import com.carrotsearch.hppc.IntObjectHashMap;
 import com.carrotsearch.hppc.procedures.IntObjectProcedure;
 import com.google.common.base.Preconditions;
 
+import io.netty.buffer.ByteBuf;
+import io.netty.channel.ChannelFuture;
+
 /**
  * Manages the creation of rpc futures for a particular socket <--> socket
  * connection. Generally speaking, there will be two threads working with this
@@ -54,10 +54,12 @@ class RequestIdMap {
     isOpen.set(false);
     if (ex != null) {
       final RpcException e = RpcException.mapException(ex);
+      IntObjectHashMap<RpcOutcome<?>> clonedMap;
       synchronized (map) {
-        map.forEach(new SetExceptionProcedure(e));
+        clonedMap = map.clone();
         map.clear();
       }
+      clonedMap.forEach(new SetExceptionProcedure(e));
     }
   }
 


Mime
View raw message