From c78fd2477633f31f60720cd3477dda4a9f2c7ef8 Mon Sep 17 00:00:00 2001 From: lyq <517717010@qq.com> Date: Wed, 24 Nov 2021 09:53:22 +0800 Subject: [PATCH] bug about dolphinscheduler-remote SendAsync (#6972) * bug about SendAsync --- .../apache/dolphinscheduler/remote/future/ResponseFuture.java | 4 ++++ .../dolphinscheduler/remote/handler/NettyClientHandler.java | 1 + 2 files changed, 5 insertions(+) diff --git a/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/future/ResponseFuture.java b/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/future/ResponseFuture.java index f9de653d90..5e5462c7e8 100644 --- a/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/future/ResponseFuture.java +++ b/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/remote/future/ResponseFuture.java @@ -105,6 +105,10 @@ public class ResponseFuture { return FUTURE_TABLE.get(opaque); } + public void removeFuture() { + FUTURE_TABLE.remove(opaque); + } + /** * whether timeout * 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 e122df4f29..ad9787d705 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 @@ -136,6 +136,7 @@ public class NettyClientHandler extends ChannelInboundHandlerAdapter { future.setResponseCommand(command); future.release(); if (future.getInvokeCallback() != null) { + future.removeFuture(); this.callbackExecutor.submit(future::executeInvokeCallback); } else { future.putResponse(command);