Repository navigation
fix(engine): resume running workflow runs when the engine starts - #4421
Merged
Merged
Conversation
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.
What
A workflow run left
runningby a restart was only taken up again when its starting thread registered with the hub, so on the background server (no app) it stayed undriven indefinitely. Runs also had no owner, so nothing could tell a run another engine process drives from one whose process died.workflow/driver.rs: adriver.jsonstamp per run (owner id =data_store::engine_owner, every 10 s, stale after 45 s, kept besiderun.jsonso the run's own saves never undo it) and an index of running runs at<config>/workflows/running/<run id>.workflow::spawnstamps and indexes the run, beats while it is driven, and drops the marker once it settles.resume_onerefuses a run another live process drives; the register path retries once after the stale window so a thread that registers right after a restart still gets its run back.workflow::keep_resuming(started inAcpEngine::start) sweeps the index at start and every minute, skipping after a clock jump: it forgets settled runs and resumes undriven ones whose thread is at Full access (local_threads::starts_threads_without_app), through the engine's own answers.docs/workflows.md› Durability.Changelog
Workflow runs cut off by a restart now continue on their own when the engine starts again, without opening their thread (Full-access threads).
Testing
cargo fmt --check,scripts/check-comments.py,scripts/check-rust-size.pylocally; unit tests for the lease, index, sweep and refusal inworkflow.rsandworkflow/driver.rsrun in CI.Closes #4387