Github user sudheeshkatkam commented on a diff in the pull request:

    https://github.com/apache/drill/pull/578#discussion_r99951476
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/rpc/control/ControlServer.java
 ---
    @@ -84,23 +87,33 @@ public ControlConnection 
initRemoteConnection(SocketChannel channel) {
           public MessageLite getHandshakeResponse(BitControlHandshake inbound) 
throws Exception {
     //        logger.debug("Handling handshake from other bit. {}", inbound);
             if (inbound.getRpcVersion() != ControlRpcConfig.RPC_VERSION) {
    -          throw new RpcException(String.format("Invalid rpc version.  
Expected %d, actual %d.", inbound.getRpcVersion(), 
ControlRpcConfig.RPC_VERSION));
    +          throw new RpcException(String.format("Invalid rpc version.  
Expected %d, actual %d.",
    +              inbound.getRpcVersion(), ControlRpcConfig.RPC_VERSION));
             }
    -        if (!inbound.hasEndpoint() || 
inbound.getEndpoint().getAddress().isEmpty() || 
inbound.getEndpoint().getControlPort() < 1) {
    -          throw new RpcException(String.format("RPC didn't provide valid 
counter endpoint information.  Received %s.", inbound.getEndpoint()));
    +        if (!inbound.hasEndpoint() ||
    +            inbound.getEndpoint().getAddress().isEmpty() ||
    +            inbound.getEndpoint().getControlPort() < 1) {
    +          throw new RpcException(String.format("RPC didn't provide valid 
counter endpoint information.  Received %s.",
    +                  inbound.getEndpoint()));
             }
             connection.setEndpoint(inbound.getEndpoint());
     
             // add the
             ControlConnectionManager manager = 
connectionRegistry.getConnectionManager(inbound.getEndpoint());
     
             // update the close handler.
    -        
proxyCloseHandler.setHandler(manager.getCloseHandlerCreator().getHandler(connection,
 proxyCloseHandler.getHandler()));
    +        
proxyCloseHandler.setHandler(manager.getCloseHandlerCreator().getHandler(connection,
    +            proxyCloseHandler.getHandler()));
     
             // add to the connection manager.
             manager.addExternalConnection(connection);
     
    -        return 
BitControlHandshake.newBuilder().setRpcVersion(ControlRpcConfig.RPC_VERSION).build();
    +        final BitControlHandshake.Builder builder = 
BitControlHandshake.newBuilder();
    +        builder.setRpcVersion(ControlRpcConfig.RPC_VERSION);
    +        if (config.getAuthProvider() != null) {
    --- End diff --
    
    There is only one authProvider per drillbit, but auth can be enabled user 
to bit, but not bit to bit, which means relying on being empty is not 
sufficient.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to