Skip to content

scheduler: prefer a live candidate over a completed one in try_subscribe - #50

Open
b7r6 wants to merge 2 commits into
mainfrom
fix/awaited-action-prefer-live
Open

b7r6 wants to merge 2 commits into
mainfrom
fix/awaited-action-prefer-live

Conversation

@b7r6

@b7r6 b7r6 commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

What and why

Lane A stability fix from the findings catalog (see nativelink-findings-2026-10-05.csv
on the meta/findings-catalog-2026-10-05 branch), rebased onto OSS main
@bf4b3aa855. This fork PR exists to validate the change on CI that is
representative of upstream PR lanes (public read-only cache, same endpoints)
before any upstream submission.

How was this verified?

The branch carries its own regression tests (fails-without where the fix
class allows it — see the branch's test commits). This PR's purpose is the
full representative CI run; green here rehearses the exact checks an
upstream PR would face.

Risk

Fork-internal validation PR; nothing lands anywhere by merging this. The
underlying fix's risk assessment happens at upstream-submission time.

AI assistance

Agent-assisted pipeline (Claude) for rebase and PR mechanics under my
direction; the fix itself carries verification in its tests.

@b7r6
b7r6 force-pushed the fix/awaited-action-prefer-live branch 3 times, most recently from 69edd1e to faed855 Compare October 8, 2026 16:32
@b7r6
b7r6 force-pushed the fix/awaited-action-prefer-live branch from faed855 to a641d5c Compare October 14, 2026 17:40
@b7r6
b7r6 force-pushed the fix/awaited-action-prefer-live branch 2 times, most recently from 49db6c0 to 1709c9c Compare October 15, 2026 13:51
b7r6 and others added 2 commits October 21, 2026 17:14
Completes the no-per-PR-OCI-builds intent: image-off-pr moved image.yaml off
PRs and TraceMachina#2877 moved the nix integration job off PRs, but main.yaml's
integration-tests (docker-compose image build + run_integration_tests.sh)
fell between them and still ran on every PR. Defer to nightly + merge-to-main,
matching TraceMachina#2880's pattern. Fork-local until folded into the upstream OCI/nightly
set.
`try_subscribe` stopped at the first exact unique-qualifier match, even
when that match was a completed record. The unique-qualifier index retains
completed records alongside any live successor, and the backend does not
order results by state, so a retained completed record could be returned
ahead of a joinable live one — forcing an unnecessary recreate and a new
operation instead of joining the live successor.

Scan every exact match and prefer a joinable (neither finished nor
abandoned) candidate, keeping the first exact match only as a fallback.

This is the selection half of finding N7. The atomic qualifier->live-op
claim (two concurrent same-qualifier submissions can still both create an
operation) needs a store primitive that does not exist today (a
compare-and-set on the shared qualifier key); that is tracked separately.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant