rocketmq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dongefore...@apache.org
Subject [46/51] [abbrv] incubator-rocketmq git commit: [ROCKETMQ-188]RemotingExecption is not consistent between invoke async and invoke oneway closes apache/incubator-rocketmq#98
Date Tue, 06 Jun 2017 03:39:06 GMT
[ROCKETMQ-188]RemotingExecption is not consistent between invoke async and invoke oneway closes
apache/incubator-rocketmq#98


Project: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/commit/7ab59a33
Tree: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/tree/7ab59a33
Diff: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/diff/7ab59a33

Branch: refs/heads/master
Commit: 7ab59a335d4745fef92d6ba8b5df14dfd179ea80
Parents: 031347d
Author: Jaskey <linjunjie1103@gmail.com>
Authored: Sat May 27 11:22:46 2017 +0800
Committer: dongeforever <zhendongliu92@yeah.net>
Committed: Tue Jun 6 11:37:29 2017 +0800

----------------------------------------------------------------------
 .../remoting/netty/NettyRemotingAbstract.java   | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/7ab59a33/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingAbstract.java
----------------------------------------------------------------------
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 cddab3d..15586cb 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
@@ -417,14 +417,18 @@ public abstract class NettyRemotingAbstract {
                 throw new RemotingSendRequestException(RemotingHelper.parseChannelRemoteAddr(channel),
e);
             }
         } else {
-            String info =
-                String.format("invokeAsyncImpl tryAcquire semaphore timeout, %dms, waiting
thread nums: %d semaphoreAsyncValue: %d", //
-                    timeoutMillis, //
-                    this.semaphoreAsync.getQueueLength(), //
-                    this.semaphoreAsync.availablePermits()//
-                );
-            PLOG.warn(info);
-            throw new RemotingTooMuchRequestException(info);
+            if (timeoutMillis <= 0) {
+                throw new RemotingTooMuchRequestException("invokeAsyncImpl invoke too fast");
+            } else {
+                String info =
+                    String.format("invokeAsyncImpl tryAcquire semaphore timeout, %dms, waiting
thread nums: %d semaphoreAsyncValue: %d", //
+                        timeoutMillis, //
+                        this.semaphoreAsync.getQueueLength(), //
+                        this.semaphoreAsync.availablePermits()//
+                    );
+                PLOG.warn(info);
+                throw new RemotingTimeoutException(info);
+            }
         }
     }
 


Mime
View raw message