Don't try to remove the task when the underlying executor fails the execution of self (#10505)

Motivation:

It makes no sense to remove the task when the underlying executor fails as we may be able to pick it up later. Beside this the used Queue doesnt support remove(...) and so will throw.

Modifications:

Remove the queue.remove(...) call

Result:

Fixes https://github.com/netty/netty/issues/10501.
This commit is contained in:
Norman Maurer 2020-08-27 08:22:41 +02:00 committed by GitHub
parent 4be9387151
commit 98c98d53d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -335,13 +335,7 @@ public final class NonStickyEventExecutorGroup implements EventExecutorGroup {
if (state.compareAndSet(NONE, SUBMITTED)) {
// Actually it could happen that the runnable was picked up in between but we not care to much and just
// execute ourself. At worst this will be a NOOP when run() is called.
try {
executor.execute(this);
} catch (Throwable e) {
// Not reset the state as some other Runnable may be added to the queue already in the meantime.
tasks.remove(command);
PlatformDependent.throwException(e);
}
executor.execute(this);
}
}
}