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

Assertion error in globalEventExecutor #4357

Closed
luengnat opened this issue Oct 14, 2015 · 4 comments
Closed

Assertion error in globalEventExecutor #4357

luengnat opened this issue Oct 14, 2015 · 4 comments
Assignees
Labels
Milestone

Comments

@luengnat
Copy link

I am using Vertx 3.1 with Netty 4.0.31. Every once in a while, I got an assert on this line:

 protected final Runnable pollScheduledTask(long nanoTime) {
    assert this.inEventLoop();

    Queue scheduledTaskQueue = this.scheduledTaskQueue;
    ScheduledFutureTask scheduledTask = scheduledTaskQueue == null?null:(ScheduledFutureTask)scheduledTaskQueue.peek();
    if(scheduledTask == null) {
        return null;
    } else if(scheduledTask.deadlineNanos() <= nanoTime) {
        scheduledTaskQueue.remove();
        return scheduledTask;
    } else {
        return null;
    }
}

with the following stack trace:
"globalEventExecutor-1-1"@4,148 in group "main": RUNNING
pollScheduledTask():83, AbstractScheduledEventExecutor {io.netty.util.concurrent}
fetchFromScheduledTaskQueue():114, GlobalEventExecutor {io.netty.util.concurrent}
takeTask():99, GlobalEventExecutor {io.netty.util.concurrent}
run():230, GlobalEventExecutor$TaskRunner {io.netty.util.concurrent}
run():137, DefaultThreadFactory$DefaultRunnableDecorator {io.netty.util.concurrent}
run():745, Thread {java.lang}

The thread that starts GlobalEventExecutor is
"main"@1 in group "main": RUNNING
():37, GlobalEventExecutor {io.netty.util.concurrent}
():35, MultithreadEventExecutorGroup {io.netty.util.concurrent}
():49, MultithreadEventLoopGroup {io.netty.channel}
():61, NioEventLoopGroup {io.netty.channel.nio}
():52, NioEventLoopGroup {io.netty.channel.nio}
():125, VertxImpl {io.vertx.core.impl}
():114, VertxImpl {io.vertx.core.impl}
():110, VertxImpl {io.vertx.core.impl}
vertx():34, VertxFactoryImpl {io.vertx.core.impl}
vertx():78, Vertx {io.vertx.core}

@normanmaurer normanmaurer self-assigned this Oct 14, 2015
@normanmaurer normanmaurer added this to the 4.0.33.Final milestone Oct 14, 2015
@normanmaurer
Copy link
Member

Will check

@normanmaurer
Copy link
Member

@luengnat ok I think i know where the problem is... working on a fix now 👍

normanmaurer added a commit that referenced this issue Oct 16, 2015
Motivation:

We started the thread before store it in a field which could lead to an assert error when the thread is executed before we actually store it.

Modifications:

Store thread before start it.

Result:

No more assert error possible.
normanmaurer added a commit that referenced this issue Oct 16, 2015
Motivation:

We started the thread before store it in a field which could lead to an assert error when the thread is executed before we actually store it.

Modifications:

Store thread before start it.

Result:

No more assert error possible.
normanmaurer added a commit that referenced this issue Oct 16, 2015
Motivation:

We started the thread before store it in a field which could lead to an assert error when the thread is executed before we actually store it.

Modifications:

Store thread before start it.

Result:

No more assert error possible.
normanmaurer added a commit that referenced this issue Oct 16, 2015
Motivation:

We started the thread before store it in a field which could lead to an assert error when the thread is executed before we actually store it.

Modifications:

Store thread before start it.

Result:

No more assert error possible.
@normanmaurer
Copy link
Member

Fixed

@tolbertam
Copy link

Oddly I started encountering this issue while upgrading from jdk 8u60 to 8u65. Not really sure why that would explain this. I was just curious @luengnat do you happen to remember what JDK you were on when you were encountering this? We've been on 4.0.26/4.0.27 for about 6 months or and I hadn't seen this issue once until we recently upgraded JDKs in our CI environment and it seems to happen occasionally.

asfgit pushed a commit to apache/flink that referenced this issue Aug 17, 2016
…ver shutdown

Due to a bug in Netty that was only fixed in 4.0.33.Final it can
happen that waiting on the termination future never succeeds.

Netty issue: netty/netty#4357
NicoK pushed a commit to NicoK/flink that referenced this issue Mar 1, 2018
…er shutdown request

There is a race condition on an assertion in Netty's event loop that may cause
tests to fail when finished early.

This was fixed in 4.0.33.Final, see netty/netty#4357.
NicoK pushed a commit to NicoK/flink that referenced this issue Mar 1, 2018
…er shutdown request

There is a race condition on an assertion in Netty's event loop that may cause
tests to fail when finished early.

This was fixed in 4.0.33.Final, see netty/netty#4357.
asfgit pushed a commit to apache/flink that referenced this issue Mar 1, 2018
…er shutdown request

There is a race condition on an assertion in Netty's event loop that may cause
tests to fail when finished early.

This was fixed in 4.0.33.Final, see netty/netty#4357.
asfgit pushed a commit to apache/flink that referenced this issue Mar 1, 2018
…er shutdown request

There is a race condition on an assertion in Netty's event loop that may cause
tests to fail when finished early.

This was fixed in 4.0.33.Final, see netty/netty#4357.

This closes #5606.
pulllock pushed a commit to pulllock/netty that referenced this issue Oct 19, 2023
Motivation:

We started the thread before store it in a field which could lead to an assert error when the thread is executed before we actually store it.

Modifications:

Store thread before start it.

Result:

No more assert error possible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants