netty5/common/src/test/java/io/netty/util/concurrent
Robert Mihaly d7bb05b1ac Ensure scheduled tasks are executed before shutdown (#9858)
Motivation:

In #9603 the executor hung on shutdown because of an abandoned task
on another executor the first was waiting for.

Modifications:

This commit modifies the executor shutdown sequence to include
switching to SHUTDOWN state and then running all remaining tasks.
This ensures that no more tasks are scheduled after SHUTDOWN and
the last pass of running remaining tasks will take it all.
Any tasks scheduled after SHUTDOWN will be rejected.

This change preserves the functionality of graceful shutdown with
quiet period and only adds one more pass of task execution after
the default shutdown process has finished and the executor is
ready for termination.

Result:

After this change tasks that succeed to be added to the executor will
be always executed. Tasks which come late will be rejected instead of
abandoned.
2019-12-11 11:33:59 +01:00
..
AbstractScheduledEventExecutorTest.java migrate java8: use lambda and method reference (#8781) 2019-01-29 14:06:05 +01:00
DefaultFutureCompletionStageTest.java Introduce Future.toStage() which allows to obtain a CompletionStage a… (#9004) 2019-04-11 14:52:33 +02:00
DefaultPromiseTest.java Avoid CancellationException construction in DefaultPromise (#9534) 2019-09-05 11:10:55 +02:00
DefaultThreadFactoryTest.java migrate java8: use lambda and method reference (#8781) 2019-01-29 14:06:05 +01:00
FastThreadLocalTest.java Allow to automatically trim the PoolThreadCache in a timely interval (#8941) 2019-03-22 11:17:40 +01:00
FutureCompletionStageTest.java Introduce Future.toStage() which allows to obtain a CompletionStage a… (#9004) 2019-04-11 14:52:33 +02:00
GlobalEventExecutorTest.java Fix flaky GlobalEventExecutorTest.* (#9074) 2019-04-29 08:33:18 +02:00
NonStickyEventExecutorGroupTest.java migrate java8: use lambda and method reference (#8781) 2019-01-29 14:06:05 +01:00
PromiseAggregatorTest.java Java 8 migration: Use diamond operator (#8749) 2019-01-22 16:07:26 +01:00
PromiseCombinerTest.java remove unused imports (#9287) 2019-06-26 21:16:16 +02:00
PromiseNotifierTest.java Java 8 migration: Use diamond operator (#8749) 2019-01-22 16:07:26 +01:00
SingleThreadEventExecutorTest.java Ensure scheduled tasks are executed before shutdown (#9858) 2019-12-11 11:33:59 +01:00
UnorderedThreadPoolEventExecutorTest.java migrate java8: use lambda and method reference (#8781) 2019-01-29 14:06:05 +01:00