This is an automated email from the ASF dual-hosted git repository.

kirs pushed a commit to branch 1.3.7-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/1.3.7-prepare by this push:
     new 796dc9d  [1.3.7-prepare#5442][Service] All tasks that need to send 
attachment will fail due to chennel idle (#5845)
796dc9d is described below

commit 796dc9df0a4b604a1ca58e06f6b7bee49e1738d8
Author: Kirs <[email protected]>
AuthorDate: Wed Jul 28 16:15:18 2021 +0800

    [1.3.7-prepare#5442][Service] All tasks that need to send attachment will 
fail due to chennel idle (#5845)
    
    pr #5442
    issue #5427
---
 .../dolphinscheduler/remote/handler/NettyClientHandler.java    | 10 ++++++----
 .../dolphinscheduler/remote/handler/NettyServerHandler.java    |  6 ++++++
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git 
a/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/handler/NettyClientHandler.java
 
b/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/handler/NettyClientHandler.java
index a988acf..a61672d 100644
--- 
a/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/handler/NettyClientHandler.java
+++ 
b/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/handler/NettyClientHandler.java
@@ -180,8 +180,8 @@ public class NettyClientHandler extends 
ChannelInboundHandlerAdapter {
      * @throws Exception
      */
     @Override
-    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) 
throws Exception {
-        logger.error("exceptionCaught : {}", cause);
+    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
+        logger.error("exceptionCaught : {}", cause.getMessage(), cause);
         
nettyRemotingClient.closeChannel(ChannelUtils.toAddress(ctx.channel()));
         ctx.channel().close();
     }
@@ -192,9 +192,11 @@ public class NettyClientHandler extends 
ChannelInboundHandlerAdapter {
             Command heartBeat = new Command();
             heartBeat.setType(CommandType.HEART_BEAT);
             heartBeat.setBody(heartBeatData);
-            ctx.writeAndFlush(heartBeat)
+            ctx.channel().writeAndFlush(heartBeat)
                 .addListener(ChannelFutureListener.CLOSE_ON_FAILURE);
-
+            if (logger.isDebugEnabled()) {
+                logger.debug("Client send heart beat to: {}", 
ChannelUtils.getRemoteAddress(ctx.channel()));
+            }
         } else {
             super.userEventTriggered(ctx, evt);
         }
diff --git 
a/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/handler/NettyServerHandler.java
 
b/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/handler/NettyServerHandler.java
index 09e41e9..a3963f7 100644
--- 
a/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/handler/NettyServerHandler.java
+++ 
b/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/handler/NettyServerHandler.java
@@ -118,6 +118,12 @@ public class NettyServerHandler extends 
ChannelInboundHandlerAdapter {
      */
     private void processReceived(final Channel channel, final Command msg) {
         final CommandType commandType = msg.getType();
+        if (CommandType.HEART_BEAT.equals(commandType)) {
+            if (logger.isDebugEnabled()) {
+                logger.debug("server receive heart beat from: host: {}", 
ChannelUtils.getRemoteAddress(channel));
+            }
+            return;
+        }
         final Pair<NettyRequestProcessor, ExecutorService> pair = 
processors.get(commandType);
         if (pair != null) {
             Runnable r = new Runnable() {

Reply via email to