Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timeout for DefaultLoopResources#disposeLater #3514

Merged
merged 4 commits into from
Nov 19, 2024
Merged

Conversation

violetagg
Copy link
Member

When shutting down EventLoopGroup, Netty tries to add for an execution a task that will stop EventLoops. However if there is a CPU intensive task running on EventLoop, the execution of the shutting down task might never happen.

This change adds a timeout for DefaultLoopResources#disposeLater so that the user will be notified that some EventLoops cannot be stopped.

Note: Having blocking and CPU intensive tasks on EventLoops is strongly discouraged and can lead to unpredictable failures.

Fixes #3509

@violetagg violetagg added the type/bug A general bug label Nov 18, 2024
@violetagg violetagg added this to the 1.1.25 milestone Nov 18, 2024
@violetagg violetagg linked an issue Nov 18, 2024 that may be closed by this pull request
@violetagg violetagg requested a review from chemicL November 18, 2024 10:04
Copy link
Member

@chemicL chemicL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some comments regarding the tests. The production code LGTM.

When shutting down EventLoopGroup, Netty tries to add for an execution a task
that will stop the EventLoops. However if there is a CPU intensive task running on an EventLoop,
the execution of the shutting down task might never happen.

This change adds a timeout for DefaultLoopResources#disposeLater so that the user
will be notified that some EventLoops cannot be stopped.

Note: Having blocking and CPU intensive tasks on EventLoops is strongly discouraged and can lead to
unpredictable failures.

Fixes #3509
@violetagg
Copy link
Member Author

@chemicL Thanks for the review!

@violetagg violetagg merged commit 09f6e16 into 1.1.x Nov 19, 2024
14 checks passed
@violetagg violetagg deleted the issue-3509 branch November 19, 2024 13:11
violetagg added a commit that referenced this pull request Nov 19, 2024
violetagg added a commit that referenced this pull request Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CPU intesive work prevents LoopResources.disposeLater from running
2 participants