Skip to content

fix(scheduler): stamp worker liveness on keepalive receipt, before inner.lock (TL1) - #57

Open
b7r6 wants to merge 2 commits into
mainfrom
b7r6/tl1-keepalive-liveness-starvation
Open

b7r6 wants to merge 2 commits into
mainfrom
b7r6/tl1-keepalive-liveness-starvation

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 b7r6/tl1-keepalive-liveness-starvation branch 3 times, most recently from 16a6dd4 to 548788f Compare October 8, 2026 15:12
@b7r6
b7r6 force-pushed the b7r6/tl1-keepalive-liveness-starvation branch 2 times, most recently from 301d971 to fe0dbb5 Compare October 15, 2026 11:19
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.
…ner.lock (TL1)

Registry is the second liveness source remove_timedout_workers consults ("alive
if EITHER source"), but refresh_worker stamped it only AFTER the inner.lock block
— which holds the lock across an await (unacked-dispatch sweep). A punctual
keepalive whose inner.lock is contended, or whose task is starved on a saturated
runtime, refreshed NEITHER liveness source before the eviction sweep read them,
falsely evicting a live worker. Transport/runtime-starvation liveness class,
seeded by Aman TraceMachina#2856 (h2-read starvation); TL1 is the sibling where a read
keepalive must still LAND through the lock.

Fix: stamp update_worker_heartbeat on receipt (lightweight RwLock insert, no
await-under-lock/store/sweep); make it monotone so an out-of-order keepalive
cannot regress last_seen. Regression heartbeat_is_monotone_never_regresses is
fails-without by construction; decoupling half exercised by the soak harness.
NOT YET built/run on metal.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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