From 98c98d53d773e509adc0d408801f9ccede68fc4d Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Thu, 27 Aug 2020 08:22:41 +0200 Subject: [PATCH] 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. --- .../util/concurrent/NonStickyEventExecutorGroup.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/common/src/main/java/io/netty/util/concurrent/NonStickyEventExecutorGroup.java b/common/src/main/java/io/netty/util/concurrent/NonStickyEventExecutorGroup.java index a2692f6696..22ddd47827 100644 --- a/common/src/main/java/io/netty/util/concurrent/NonStickyEventExecutorGroup.java +++ b/common/src/main/java/io/netty/util/concurrent/NonStickyEventExecutorGroup.java @@ -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); } } }