gabrywu commented on a change in pull request #3868:
URL: 
https://github.com/apache/incubator-dolphinscheduler/pull/3868#discussion_r502733160



##########
File path: 
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/handler/NettyClientHandler.java
##########
@@ -175,4 +183,16 @@ public void exceptionCaught(ChannelHandlerContext ctx, 
Throwable cause) throws E
         ctx.channel().close();
     }
 
+    @Override
+    public void userEventTriggered(ChannelHandlerContext ctx, Object evt) 
throws Exception {
+        if (evt instanceof IdleStateEvent) {
+            Command heartBeat = new Command();

Review comment:
       It's better if we distinguish the READER_IDLE and WRITER_IDLE event

##########
File path: 
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/handler/NettyServerHandler.java
##########
@@ -158,16 +168,26 @@ public void 
channelWritabilityChanged(ChannelHandlerContext ctx) throws Exceptio
         if (!ch.isWritable()) {
             if (logger.isWarnEnabled()) {
                 logger.warn("{} is not writable, over high water level : {}",
-                        ch, config.getWriteBufferHighWaterMark());
+                    ch, config.getWriteBufferHighWaterMark());
             }
 
             config.setAutoRead(false);
         } else {
             if (logger.isWarnEnabled()) {
                 logger.warn("{} is writable, to low water : {}",
-                        ch, config.getWriteBufferLowWaterMark());
+                    ch, config.getWriteBufferLowWaterMark());
             }
             config.setAutoRead(true);
         }
     }
+
+    @Override
+    public void userEventTriggered(ChannelHandlerContext ctx, Object evt) 
throws Exception {
+        // send heartbeat when read idle.
+        if (evt instanceof IdleStateEvent) {

Review comment:
       It's better if we distinguish the READER_IDLE and WRITER_IDLE event
   
   




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

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


Reply via email to