rymarm commented on a change in pull request #2333:
URL: https://github.com/apache/drill/pull/2333#discussion_r734579504



##########
File path: exec/rpc/src/main/java/org/apache/drill/exec/rpc/BasicClient.java
##########
@@ -121,7 +123,8 @@ protected void initChannel(SocketChannel ch) throws 
Exception {
               pipe.addLast(RpcConstants.IDLE_STATE_HANDLER, pingHandler);
             }
 
-            pipe.addLast(RpcConstants.MESSAGE_HANDLER, new 
InboundHandler(connection));
+            messageHandler = new InboundHandler(connection);
+            pipe.addLast(RpcConstants.MESSAGE_HANDLER, messageHandler);

Review comment:
       No, I've added it to make `messageHandler` accessible in `BasicClient` 
to use it inside `BasicClient#ping` for [listener 
subscribing](https://github.com/apache/drill/blob/66f3fdebe0a7d8d79052d55968a76301bf5cd673/exec/rpc/src/main/java/org/apache/drill/exec/rpc/BasicClient.java#L341):
   ```
     public boolean ping(int timeout) throws DrillRuntimeException {
       connection.getChannel()
               .writeAndFlush(PING_MESSAGE);
       PongListener pongListener = new PongListener();
       messageHandler.subscribeForPongMessage(pongListener);
   
       return pongListener.pongIsReceived(timeout);
     }
   ```
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to