Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] The log info about eventQueue.size() may be inaccurate in NettyEventExecutor #2535

Closed
horizonzy opened this issue Dec 30, 2020 · 0 comments

Comments

@horizonzy
Copy link
Member

BUG REPORT

  1. Please describe the issue you observed:
    I notice the code in NettyEventExecutor as follow:
    class NettyEventExecutor extends ServiceThread {
        private final LinkedBlockingQueue<NettyEvent> eventQueue = new LinkedBlockingQueue<NettyEvent>();
        private final int maxSize = 10000;

        public void putNettyEvent(final NettyEvent event) {
            if (this.eventQueue.size() <= maxSize) {
                this.eventQueue.add(event);
            } else {
                log.warn("event queue size[{}] enough, so drop this event {}", this.eventQueue.size(), event.toString());
            }
        }
     ......
    }

When the eventQueue.size() more than 10000, the event will be discard, then log info.
Because the putNettyEvent is not sync, so the eventQueue can more than 10000, when putEvent to queue, the size more than 10000. And when log info, the size may less than 10000.

It should use one variable value to log it.

horizonzy added a commit to horizonzy/rocketmq that referenced this issue Dec 30, 2020
yuz10 pushed a commit that referenced this issue Dec 10, 2021
* [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.
@yuz10 yuz10 closed this as completed Dec 10, 2021
@yuz10 yuz10 added this to the 4.9.3 milestone Dec 10, 2021
devfat pushed a commit to devfat/rocketmq that referenced this issue Mar 3, 2022
* [ISSUE apache#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.
GenerousMan pushed a commit to GenerousMan/rocketmq that referenced this issue Aug 12, 2022
* [ISSUE apache#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants