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
parent a399175b52
commit a0905073d4

View File

@ -331,13 +331,7 @@ public final class NonStickyEventExecutorGroup implements EventExecutorGroup {
if (state.compareAndSet(NONE, SUBMITTED)) { 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 // 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. // execute ourself. At worst this will be a NOOP when run() is called.
try { executor.execute(this);
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);
}
} }
} }