This is an automated email from the ASF dual-hosted git repository.
vongosling pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/master by this push:
new d4d02b5 Release semaphore when timeout
d4d02b5 is described below
commit d4d02b5e017ebf8c7d3405516264645280cf57fa
Author: maowei.ymw <[email protected]>
AuthorDate: Thu Dec 13 17:07:30 2018 +0800
Release semaphore when timeout
---
.../java/org/apache/rocketmq/remoting/netty/NettyRemotingAbstract.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingAbstract.java
b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingAbstract.java
index 8dccebc..9b02640 100644
---
a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingAbstract.java
+++
b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingAbstract.java
@@ -410,7 +410,8 @@ public abstract class NettyRemotingAbstract {
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);