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 b10824b24d..b782d86b0f 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 @@ -21,10 +21,8 @@ import org.apache.dolphinscheduler.rpc.common.RpcRequest; import org.apache.dolphinscheduler.rpc.common.RpcResponse; import java.util.concurrent.CountDownLatch; -import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; /** * RpcFuture @@ -61,6 +59,7 @@ public class RpcFuture implements Future { @Override public RpcResponse get() throws InterruptedException { + // the timeout period should be defined by the business party boolean success = latch.await(5, TimeUnit.SECONDS); if (!success) { throw new RuntimeException("Timeout exception. Request id: " + this.requestId diff --git a/dolphinscheduler-remote/src/test/java/org/apache/dolphinscheduler/rpc/UserService.java b/dolphinscheduler-remote/src/test/java/org/apache/dolphinscheduler/rpc/UserService.java index 967a42378e..ba990d0772 100644 --- a/dolphinscheduler-remote/src/test/java/org/apache/dolphinscheduler/rpc/UserService.java +++ b/dolphinscheduler-remote/src/test/java/org/apache/dolphinscheduler/rpc/UserService.java @@ -33,7 +33,7 @@ public class UserService implements IUserService { @Override public Integer hi(int num) { - System.out.println("hihihihi+"+num); + System.out.println("hihihihi+" + num); return ++num; } }