feat: graceful worker shutdown#2274
feat: graceful worker shutdown#2274MasterPtato wants to merge 1 commit into03-25-feat_workflows_defererred_sqlite_tasksfrom
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.
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
WorkflowCtxto enable interrupting workflows at any point during execution - Modified
ListenCtxto use immutable reference toWorkflowCtx, improving signal handling during shutdown - Added shutdown sequence in
worker.rsthat waits for running workflows with timeout and handles SIGINT/SIGTERM - Implemented parallel execution using
ctx.joinin 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