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

    https://github.com/apache/drill/pull/578#discussion_r99889252
  
    --- 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 --
    
    instead, maybe have a method to get all mechanisms. If empty, it means that 
authentication is disabled (should match protobuf behavior of returning empty 
list by default)


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