Skip to content

Commit

Permalink
DRILL-4085: Disable RPC thread offload until concurrency bug is found.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacques-n committed Nov 13, 2015
1 parent bdd2386 commit 2359294
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions exec/rpc/src/main/java/org/apache/drill/exec/rpc/RpcBus.java
Expand Up @@ -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);

Expand Down Expand Up @@ -256,16 +257,25 @@ void sendFailure(UserRpcException e){

}

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
Expand Down

0 comments on commit 2359294

Please sign in to comment.