Repository navigation
fix: preserve schedule owner state after lock contention - #2675
Merged
nicobailon merged 4 commits intoOct 4, 2026
Merged
Conversation
Contributor
|
Owner
|
Merged, thanks @quifox. A fresh review confirmed the stale-overwrite race on main and that all seven new regressions fail without the fix. The Windows failure was in an unrelated integration test and passed on rerun. |
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.
Two sessions can read the same due schedule before competing for active.lock. The losing session writes its stale schedule over the winner, erasing activeRunId and allowing deletion while the winning task is running.
The EEXIST branch now reads current state for the skip receipt and local timer only. It never saves the stale schedule or releases the owner's lock. Recurring contenders defer locally without consuming the stored cursor; one-shot contenders stop automatic retry, and an already deleted record stays absent.
Validation: 93 focused tests pass on Linux Node 24, including 7 targeted ownership and timer checks that fail on the original code. Three two-process reproductions cover interval, calendar and one-shot schedules. Typecheck passes. The PR enables the new focused regressions on macOS; the existing unit-test matrix covers Linux and Windows. Exact-head CI remains the merge gate.
Review follow-up (2026-10-04): the macOS job now explicitly runs only the claim contention regression present in this branch. Conditional commands for absent settings, history and launch test files have been removed.
The focused macOS claim check passes. The latest head still has a required Windows integration failure in
routes retained workflow follow-ups to distinct outputs without overwriting the writer report; the affected test and foreground executor are unchanged by this PR. Required exact-head CI remains a merge gate.Final CI check on
fbdb1b6f: focused regressions and automated review pass, but test (windows-2) failed: the unchanged retained workflow follow-up integration assertion reported zero running children on Windows. The corresponding focused test passes locally on Linux. Required exact-head CI remains a merge gate; a maintainer rerun is needed to assess the platform failure.