From 9fe30e2e27d34e0df0c575e0fcb7c323f17210cc Mon Sep 17 00:00:00 2001 From: "maowei.ymw" Date: Tue, 18 Dec 2018 16:25:25 +0800 Subject: [PATCH] FixSemaphoreProblem --- .../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 8dccebc0..9b026403 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); -- GitLab