You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by yu...@apache.org on 2021/12/10 15:04:19 UTC

[rocketmq] branch develop updated: [ISSUE #2535] Polish log variable. (#2536)

This is an automated email from the ASF dual-hosted git repository.

yuzhou pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git


The following commit(s) were added to refs/heads/develop by this push:
     new 1635856  [ISSUE #2535] Polish log variable. (#2536)
1635856 is described below

commit 1635856fea87a1a98056e8f2ab6f2c94f299573d
Author: 赵延 <ho...@apache.org>
AuthorDate: Fri Dec 10 23:04:08 2021 +0800

    [ISSUE #2535] Polish log variable. (#2536)
    
    * [ISSUE #2535] Use one variable value to log info when eventQueue's size more than 10000.
    
    * add the queue limit value when evenQueue size is enough.
---
 .../org/apache/rocketmq/remoting/netty/NettyRemotingAbstract.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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 b2e7294..f02518b 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
@@ -570,10 +570,11 @@ public abstract class NettyRemotingAbstract {
         private final int maxSize = 10000;
 
         public void putNettyEvent(final NettyEvent event) {
-            if (this.eventQueue.size() <= maxSize) {
+            int currentSize = this.eventQueue.size();
+            if (currentSize <= maxSize) {
                 this.eventQueue.add(event);
             } else {
-                log.warn("event queue size[{}] enough, so drop this event {}", this.eventQueue.size(), event.toString());
+                log.warn("event queue size [{}] over the limit [{}], so drop this event {}", currentSize, maxSize, event.toString());
             }
         }