You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ki...@apache.org on 2021/05/10 19:04:08 UTC

[dolphinscheduler] branch dev updated: [Bug][Service] All tasks that need to send attachment will fail due to chennel idle (#5442)

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

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


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

commit fbef290cc5e611bfee7a430472b2b2774dd6d921
Author: ruanwenjun <86...@qq.com>
AuthorDate: Tue May 11 03:03:52 2021 +0800

    [Bug][Service] All tasks that need to send attachment will fail due to chennel idle (#5442)
---
 .../apache/dolphinscheduler/remote/handler/NettyClientHandler.java  | 6 ++++--
 .../apache/dolphinscheduler/remote/handler/NettyServerHandler.java  | 6 ++++++
 2 files changed, 10 insertions(+), 2 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 c057850..e122df4 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
@@ -184,9 +184,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 322dfae..2be00c9 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
@@ -116,6 +116,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 = () -> {