Repository navigation
Conversation
10 of 19 tasks
Author
|
Closing this PR rather than continuing with a rewrite. Current This closure is a maintenance decision, not a claim that the remaining recovery gap is fully fixed upstream. Thanks to everyone who looked at the issue. |
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 does this PR do?
When an adopted restart-safe cron worker exits before writing a terminal result, its ledger row is still retained as
unknownbecause external side effects may have happened. This change additionally projects that recovered attempt once into the job record as a failed run, solast_run_at,last_status,last_error, claims, incidents, and failure delivery no longer remain stale. The projection is keyed by execution ID under the jobs-store lock, preventing overlapping recovery scans from advancing a schedule or re-alerting twice.Related Issue
Fixes #120328
Type of Change
Changes Made
cron/executions.py— returns the exact compare-and-swap recovered rows to scheduler callers and records the one recovery delivery outcome without changing the immutableunknownstate.cron/jobs.py— projects a recovered execution intojobs.jsononce, updates failed-run fields, clears claims, and advances the next schedule.cron/scheduler.pyandcron/scheduler_tick.py— apply the existing incident and failure-delivery path both immediately after an adopted worker exit and during periodic dead-owner recovery.tests/cron/test_dead_owner_claim_reclaim.py— covers adopted-worker recovery, jobs/incident/delivery projection, and overlapping projection idempotency.How to Test
HERMES_PYTHON="$(command -v python3)" scripts/run_tests.sh tests/cron/test_dead_owner_claim_reclaim.py tests/cron/test_execution_ledger.py tests/cron/test_restart_safe_worker.py -q— 55 passed, 4 Linux-only skipped on macOS.python3 -m ruff check cron/executions.py cron/jobs.py cron/scheduler.py cron/scheduler_tick.py tests/cron/test_dead_owner_claim_reclaim.py tests/cron/test_restart_safe_worker.py— passed.Evidence
origin/mainbecauselast_statusremainsNoneafter the execution becomesunknown.last_status == "error", creates one incident, delivers one failure notice, and recordsdelivery_outcome == "delivered".Review follow-up
Docker and Nix CI lanes are derived from this Python production change but were not run locally. Linux-only tests are left to CI; they were skipped on this macOS host.
Checklist
Code
Documentation & Housekeeping
cli-config.yaml.example: N/ACONTRIBUTING.mdorAGENTS.md: N/A