diff --git a/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/client/ConsumerInterceptor.java b/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/client/ConsumerInterceptor.java index 15281a3d2c..ad7b5d2c09 100644 --- a/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/client/ConsumerInterceptor.java +++ b/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/client/ConsumerInterceptor.java @@ -72,6 +72,7 @@ public class ConsumerInterceptor { rsp = nettyClient.sendMsg(host, protocol, async); } catch (InterruptedException e) { logger.warn("send msg error ", e); + Thread.currentThread().interrupt(); } //success if (null != rsp && rsp.getStatus() == 0) { diff --git a/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/future/RpcFuture.java b/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/future/RpcFuture.java index 73ceb25404..b10824b24d 100644 --- a/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/future/RpcFuture.java +++ b/dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/future/RpcFuture.java @@ -39,9 +39,9 @@ public class RpcFuture implements Future { private long requestId; - public RpcFuture(RpcRequest rpcRequest,long requestId) { + public RpcFuture(RpcRequest rpcRequest, long requestId) { this.request = rpcRequest; - this.requestId=requestId; + this.requestId = requestId; } @Override @@ -71,9 +71,9 @@ public class RpcFuture implements Future { } @Override - public RpcResponse get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { + public RpcResponse get(long timeout, TimeUnit unit) throws InterruptedException { boolean success = latch.await(timeout, unit); - if (!success) { + if (!success) { throw new RuntimeException("Timeout exception. Request id: " + requestId + ". Request class name: " + this.request.getClassName() + ". Request method: " + this.request.getMethodName()); diff --git a/dolphinscheduler-remote/src/test/java/org/apache/dolphinscheduler/rpc/Server.java b/dolphinscheduler-remote/src/test/java/org/apache/dolphinscheduler/rpc/Server.java index b9a660aa89..b9b098a17c 100644 --- a/dolphinscheduler-remote/src/test/java/org/apache/dolphinscheduler/rpc/Server.java +++ b/dolphinscheduler-remote/src/test/java/org/apache/dolphinscheduler/rpc/Server.java @@ -21,6 +21,6 @@ import org.apache.dolphinscheduler.rpc.remote.NettyServer; public class Server { public static void main(String[] args) { - NettyServer nettyServer=new NettyServer(new NettyServerConfig()); + NettyServer nettyServer = new NettyServer(new NettyServerConfig()); } }