DotNetty
DotNetty copied to clipboard
Ignore WAKEUP_TASK in SingleThreadEventExecutor.PollTask
Without this, it may lead to an infinite loop.
I didn't find a way to create an test for this. It an concurrency issue and only happen in rare case.
Shutdown will never finished if an task is enqueued during CleanupAndTerminate()
. If there is any tasks left, RunAllTasks
will return true and call WakeUp(true)
, and WakeUp(true)
will enqueue an WAKEUP_TASK
and it makes the next call to RunAllTasks
still return true.
https://github.com/Azure/DotNetty/blob/a9d0723ba5994c1b98bb43ed452996d51beb1a7c/src/DotNetty.Common/Concurrency/SingleThreadEventExecutor.cs#L115-L119
https://github.com/Azure/DotNetty/blob/a9d0723ba5994c1b98bb43ed452996d51beb1a7c/src/DotNetty.Common/Concurrency/SingleThreadEventExecutor.cs#L375-L381
https://github.com/Azure/DotNetty/blob/a9d0723ba5994c1b98bb43ed452996d51beb1a7c/src/DotNetty.Common/Concurrency/SingleThreadEventExecutor.cs#L317-L328