Skip to content

Commit

Permalink
Release semaphore when timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
maowei-ymw authored and vongosling committed Dec 14, 2018
1 parent b32668b commit d4d02b5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ public void invokeAsyncImpl(final Channel channel, final RemotingCommand request
final SemaphoreReleaseOnlyOnce once = new SemaphoreReleaseOnlyOnce(this.semaphoreAsync);
long costTime = System.currentTimeMillis() - beginStartTime;
if (timeoutMillis < costTime) {
throw new RemotingTooMuchRequestException("invokeAsyncImpl call timeout");
once.release();
throw new RemotingTimeoutException("invokeAsyncImpl call timeout");
}

final ResponseFuture responseFuture = new ResponseFuture(channel, opaque, timeoutMillis - costTime, invokeCallback, once);
Expand Down

0 comments on commit d4d02b5

Please sign in to comment.