fix: add a 5 second timeout for tokio_runtime shutdown#8771
Merged
Conversation
tokio_runtime to end on a graceful shutdown attempttokio_runtime shutdown
mattsse
requested changes
Jun 12, 2024
onbjerg
reviewed
Jun 12, 2024
Collaborator
onbjerg
left a comment
There was a problem hiding this comment.
can you include the motivation in the pr?
mattsse
approved these changes
Jun 12, 2024
Collaborator
mattsse
left a comment
There was a problem hiding this comment.
tested this a few times, seems fine
| // manager which fires the shutdown signal to all tasks spawned via the task | ||
| // executor and awaiting on tasks spawned with graceful shutdown | ||
| task_manager.graceful_shutdown_with_timeout(std::time::Duration::from_secs(10)); | ||
| task_manager.graceful_shutdown_with_timeout(Duration::from_secs(5)); |
Collaborator
There was a problem hiding this comment.
this seems reasonable, none of our graceful tasks should even take 1s to shutdown
emhane
pushed a commit
that referenced
this pull request
Jun 13, 2024
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Waits 5 seconds for
tokio_runtimeto shutdown. Making a best effort to allow components to have a chance to drop cleanly should be preferred. Examples: allows forStorageLockfile to be cleared (not a must) or errors to be properly printed (eg. #8772).Acknowledging that for long blocking tasks, this will timeout anyway. (eg. sender recovery stage)
Also, reduces
task_managershutdown timeout to 5 seconds as to not increase the worst case waiting time.