This is an automated email from the ASF dual-hosted git repository. victory pushed a commit to branch 2.7.3-release in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/2.7.3-release by this push: new 8534f48 Observation of performance degradation when running under JDK 8 (#4381) 8534f48 is described below commit 8534f48f61bfa0134a0eacf042a4f3269f779f0e Author: ken.lj <ken.lj...@gmail.com> AuthorDate: Wed Jun 26 11:37:58 2019 +0800 Observation of performance degradation when running under JDK 8 (#4381) --- .../main/java/org/apache/dubbo/rpc/protocol/AsyncToSyncInvoker.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/protocol/AsyncToSyncInvoker.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/protocol/AsyncToSyncInvoker.java index 5c06b4e..93fb5d8 100644 --- a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/protocol/AsyncToSyncInvoker.java +++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/protocol/AsyncToSyncInvoker.java @@ -27,6 +27,10 @@ import org.apache.dubbo.rpc.RpcException; import org.apache.dubbo.rpc.RpcInvocation; import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; + +import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_TIMEOUT; +import static org.apache.dubbo.common.constants.CommonConstants.TIMEOUT_KEY; /** * This class will work as a wrapper wrapping outside of each protocol invoker. @@ -51,7 +55,7 @@ public class AsyncToSyncInvoker<T> implements Invoker<T> { try { if (InvokeMode.SYNC == ((RpcInvocation)invocation).getInvokeMode()) { - asyncResult.get(); + asyncResult.get(getUrl().getParameter(TIMEOUT_KEY, DEFAULT_TIMEOUT), TimeUnit.MILLISECONDS); } } catch (InterruptedException e) { throw new RpcException("Interrupted unexpectedly while waiting for remoting result to return! method: " + invocation.getMethodName() + ", provider: " + getUrl() + ", cause: " + e.getMessage(), e);