lizhanhui commented on code in PR #4534:
URL: https://github.com/apache/rocketmq/pull/4534#discussion_r911581397


##########
remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingAbstract.java:
##########
@@ -567,15 +567,12 @@ public void operationComplete(ChannelFuture f) throws 
Exception {
     }
 
     class NettyEventExecutor extends ServiceThread {
-        private final LinkedBlockingQueue<NettyEvent> eventQueue = new 
LinkedBlockingQueue<NettyEvent>();
         private final int maxSize = 10000;
+        private final LinkedBlockingQueue<NettyEvent> eventQueue = new 
LinkedBlockingQueue<NettyEvent>();
 
         public void putNettyEvent(final NettyEvent event) {
-            int currentSize = this.eventQueue.size();
-            if (currentSize <= maxSize) {
-                this.eventQueue.add(event);
-            } else {
-                log.warn("event queue size [{}] over the limit [{}], so drop 
this event {}", currentSize, maxSize, event.toString());
+            if (!eventQueue.offer(event)) {

Review Comment:
   This comment: 
https://github.com/apache/rocketmq/issues/4533#issuecomment-1171878588



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to