-
Notifications
You must be signed in to change notification settings - Fork 83
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
feat: graceful worker shutdown #2274
feat: graceful worker shutdown #2274
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Deploying rivet with
|
Latest commit: |
580531f
|
Status: | ✅ Deploy successful! |
Preview URL: | https://0fcd18b8.rivet.pages.dev |
Branch Preview URL: | https://03-26-feat-graceful-worker-s.rivet.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR implements graceful worker shutdown functionality across the workflow system, focusing on safe termination of running workflows and proper resource cleanup.
- Added stop channel and check_stop() method in
WorkflowCtx
to enable interrupting workflows at any point during execution - Modified
ListenCtx
to use immutable reference toWorkflowCtx
, improving signal handling during shutdown - Added shutdown sequence in
worker.rs
that waits for running workflows with timeout and handles SIGINT/SIGTERM - Implemented parallel execution using
ctx.join
in pegboard client workflow, replacing sequential operations that had deadlock issues - Added max_retries=15 for drain/undrain pegboard client activities to handle transient failures during shutdown
15 file(s) reviewed, 7 comment(s)
Edit PR Review Bot Settings | Greptile
d104e87
to
f6a4e70
Compare
45c6cc6
to
ceec131
Compare
f6a4e70
to
eec0c12
Compare
ceec131
to
4739210
Compare
eec0c12
to
9dcc276
Compare
4739210
to
023537c
Compare
9dcc276
to
580531f
Compare
Deploying rivet-hub with
|
Latest commit: |
580531f
|
Status: | ✅ Deploy successful! |
Preview URL: | https://eb1573f9.rivet-hub-7jb.pages.dev |
Branch Preview URL: | https://03-26-feat-graceful-worker-s.rivet-hub-7jb.pages.dev |
Merge activity
|
<!-- Please make sure there is an issue that this PR is correlated to. --> Fixes RVT-4594 ## Changes <!-- If there are frontend changes, please include screenshots. -->
Fixes RVT-4594
Changes