DotNetty icon indicating copy to clipboard operation
DotNetty copied to clipboard

Ignore WAKEUP_TASK in SingleThreadEventExecutor.PollTask

Open yyjdelete opened this issue 4 years ago • 1 comments

Without this, it may lead to an infinite loop.

yyjdelete avatar Nov 08 '19 04:11 yyjdelete

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

yyjdelete avatar Nov 08 '19 04:11 yyjdelete