drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jacq...@apache.org
Subject [44/45] drill git commit: DRILL-4085: Disable RPC thread offload until concurrency bug is found.
Date Fri, 13 Nov 2015 02:38:14 GMT
DRILL-4085: Disable RPC thread offload until concurrency bug is found.


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

Branch: refs/heads/master
Commit: 2359294cfc936773ebcc3f187b79222ec88cc1e5
Parents: bdd2386
Author: Jacques Nadeau <jacques@apache.org>
Authored: Fri Nov 6 14:25:05 2015 -0800
Committer: Jacques Nadeau <jacques@apache.org>
Committed: Thu Nov 12 18:36:26 2015 -0800

----------------------------------------------------------------------
 .../main/java/org/apache/drill/exec/rpc/RpcBus.java   | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/2359294c/exec/rpc/src/main/java/org/apache/drill/exec/rpc/RpcBus.java
----------------------------------------------------------------------
diff --git a/exec/rpc/src/main/java/org/apache/drill/exec/rpc/RpcBus.java b/exec/rpc/src/main/java/org/apache/drill/exec/rpc/RpcBus.java
index 61922a1..b6f3032 100644
--- a/exec/rpc/src/main/java/org/apache/drill/exec/rpc/RpcBus.java
+++ b/exec/rpc/src/main/java/org/apache/drill/exec/rpc/RpcBus.java
@@ -59,6 +59,7 @@ public abstract class RpcBus<T extends EnumLite, C extends RemoteConnection>
imp
   final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(this.getClass());
 
   private static final OutboundRpcMessage PONG = new OutboundRpcMessage(RpcMode.PONG, 0,
0, Acks.OK);
+  private static final boolean ENABLE_SEPARATE_THREADS = "true".equals(System.getProperty("drill.enable_rpc_offload"));
 
   protected final CoordinationQueue queue = new CoordinationQueue(16, 16);
 
@@ -256,16 +257,25 @@ public abstract class RpcBus<T extends EnumLite, C extends RemoteConnection>
imp
 
   }
 
+  private class SameExecutor implements Executor {
+
+    @Override
+    public void execute(Runnable command) {
+      command.run();
+    }
+
+  }
 
   protected class InboundHandler extends MessageToMessageDecoder<InboundRpcMessage>
{
 
-    private final RpcEventHandler exec;
+    private final Executor exec;
     private final C connection;
 
     public InboundHandler(C connection) {
       super();
       this.connection = connection;
-      this.exec = new RpcEventHandler(rpcConfig.getExecutor());
+      final Executor underlyingExecutor = ENABLE_SEPARATE_THREADS ? rpcConfig.getExecutor()
: new SameExecutor();
+      this.exec = new RpcEventHandler(underlyingExecutor);
     }
 
     @Override


Mime
View raw message