Skip to content

Commit

Permalink
Observation of performance degradation when running under JDK 8 (#4381)
Browse files Browse the repository at this point in the history
  • Loading branch information
chickenlj authored and cvictory committed Jun 26, 2019
1 parent 6b7d118 commit 8534f48
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
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.
Expand All @@ -51,7 +55,7 @@ public Result invoke(Invocation invocation) throws RpcException {

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);
Expand Down

0 comments on commit 8534f48

Please sign in to comment.