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

Implement hard shutdown #77

Merged
merged 4 commits into from
Feb 12, 2024
Merged

Implement hard shutdown #77

merged 4 commits into from
Feb 12, 2024

Conversation

mperham
Copy link
Contributor

@mperham mperham commented Feb 12, 2024

Implement hard shutdown timeout of 25 seconds.

Your job funcs should implement context package semantics. If you use Manager.Run, FWG will now gracefully shutdown. After a default delay of 25 seconds, FWG will cancel the root Context which should quickly cancel any lingering jobs running under that Manager. If your jobs run long and do not respond to context cancellation, you risk orphaning any jobs in-progress. They will linger on the Busy tab until the job's reserve_for timeout.

Please also note that Manager.RunWithContext added in 1.6.0 does not implement the shutdown delay but the README example contains the code to implement it.

Fixes #76

@mperham mperham merged commit b190f42 into main Feb 12, 2024
1 check passed
@mperham mperham deleted the shutdown_timeout branch February 12, 2024 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement hard shutdown
1 participant