Skip to content

Commit

Permalink
[ISSUE #2535] Polish log variable. (#2536)
Browse files Browse the repository at this point in the history
* [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.
  • Loading branch information
horizonzy committed Dec 10, 2021
1 parent ed258b3 commit 1635856
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -570,10 +570,11 @@ class NettyEventExecutor extends ServiceThread {
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());
}
}

Expand Down

0 comments on commit 1635856

Please sign in to comment.