Repository navigation
Conversation
|
36a62e3 to
aaa8802
Compare
|
Speaking as Kun's firstmate: first stamp vs tip HEAD contract-class: restore — start path must not launch a second supervisor beside a live verified lock owner when heartbeat ages under load; existing single-owner invariant. VISION (per-rule)
Waiting on CI (behavior/lint lanes in progress on run 36818657858). Will auto-merge on green if still restore + safe. No Firstmate flag. |
|
Speaking as Kun's firstmate: CI run contract-class: restore unchanged. Not mergeable until Lint 1 is green. Not otherwise-ready → no Firstmate flag. Please rebase onto a tip that carries the lint envelope fix (or coordinate with #6271) and re-push no-mistakes if the head moves. |
|
Speaking as Kun's firstmate: restamp vs tip VISION (per-rule): One captain/interface — aligns. Authority explicit — aligns. Scripts vs agents — aligns (ownership/heartbeat mechanics in scripts). Restart non-event / durability — aligns (live verified owner not duplicated under aged heartbeat). Delegation spine — aligns (remote secondmate supervision). Fleet outlives vendor — n/a. Scope — aligns. contract-class: restore — concrete existing remote job supervisor start path wrongly launched a second supervisor beside a live verified lock owner when heartbeat aged under slow serving. Tip accepts verified live owner before heartbeat probe; separate heartbeat refresher. Complements open #5851 (owner-identity); body refs #2921. Attestation MATCH. Greptile 5/5. Ahead/behind diverged — CONFLICTING/DIRTY; author must rebase onto current main (prior lint1 memory note may already be moot after tip advanced). Fork CI/NM re-approved this pass. Not otherwise auto-merge-ready → no conflict resolve here. No Firstmate flag. |
This comment has been minimized.
This comment has been minimized.
3645190 to
b377e59
Compare
…ied lock owner The Linux start path probed the readiness heartbeat before checking the worker lock. A live lock owner whose recorded pid, start time and command still matched was therefore read as dead whenever its heartbeat aged past the probe's ten-second bound on a loaded host, and another restart supervisor was launched beside it. Accept such an owner before the heartbeat probe. Bind heartbeat refreshes to the readiness object: where a Linux fd path reaches it, the heartbeat refreshes only the ready file it opened or recreated, and it recreates a missing ready file through a no-clobber link after its ownership check. A refresh delayed past a loss of ownership can then neither refresh nor overwrite a replacement owner's readiness. The LaunchAgent fault injector now matches the ready file rather than its pathname, since refreshes may arrive through that fd path. Refs kunchenguid#2921
…ker.pid The Linux start path now checks for a live lock owner whose recorded pid, start time and command match before it reads the published worker.pid, so a start between lock publication and worker.pid publication counts the owner as running instead of launching another supervisor. Identity publication order and identity handling are unchanged. Regression tests cover a start with an absent and with a stale worker.pid.
…s running A worker publishes its lock owner records before its code identity. A Linux start in that window found the verified live owner, then failed the identity comparison against the not-yet-published identity file and stopped the initializing worker's whole tree before launching a replacement. Treat a verified live lock owner without a published identity as running, as the LaunchAgent path already does; an identity mismatch still stops the owner once the identity is published. Refs kunchenguid#2921
…ing lock ownership
1ee85f7 to
9b03374
Compare
|
Speaking as Kun's firstmate: thanks @Diabl0570 for bringing this back up to date — the new head reads well. I reviewed head
VISION check: it aligns. It keeps one live remote-job owner across restarts, the mechanics stay in scripts, and there's no new captain-facing surface. Contract class: restore. The Linux start path was already meant to reuse a live verified owner and was duplicating it. The one scenario you couldn't drive live (the inode-bound heartbeat refresh, which needs |
Intent
Follow up existing PR #6217 and synchronize with latest main through no-mistakes. User asked to clone repository and use sub-agents for necessary PR follow-up and main sync. Preserve the focused fix preventing duplicate Linux remote-job supervisors, including live lock-owner checks and inode-safe readiness heartbeat refresh, while reconciling newer main implementations. Preserve previous branch commits and resolved initializing-worker race feedback; fix necessary failures. Update only existing Diabl0570 fork branch and existing PR. Do not merge, post comments, alter accounts or shared fleets, or launch real vendor workers. Use focused executable tests and accurately report Linux-only evidence unavailable on this macOS host.
What Changed
fm_remote_job_worker_owned_aliveinbin/fm-remote-job-lib.shnow treats a verified live lock owner (one whose recorded pid, start time and command still match) as running before it readsworker.pid, regardless of heartbeat age.fm_remote_job_start_linux_workerreturns early for an owner that has not yet published its code identity, so it only stops the owner once that identity has been published and does not match. Before this change, the start path could launch more supervisors beside a slow or still-initializing owner.bin/fm-remote-job-worker.shchanges how the heartbeat refreshes readiness:/proc/self/fd/3where that path exists) and refreshes that file, not the pathname.ln, so it never overwrites readiness that a replacement owner published in the meantime.tests/fm-remote-job.test.sh: live owners with aged readiness, absent or stale public PID records, unpublished identity over an absent or stale predecessor identity, and readiness binding where fd paths exist. Thetouchstub intests/fm-remote-job-launchagent.test.shnow matches the ready file by identity (-ef), not by path.docs/remote-secondmates.mdpoints to the new owner-reuse contract and test coverage.🤖 Generated with Claude Code
Risk Assessment
✅ Low: The focused changes address predecessor identity cleanup and preserve ownership checks and readiness gating without substantiated regressions.
Testing
I drove the real worker and start-path scripts under the Linux platform override on this macOS host, running the duplicate-worker section of the test file on its own. All five cases passed: - an owner with an absent public PID - an owner with a stale public PID - an owner with no published code identity, over absent predecessor state - the same, over stale predecessor state (the new R1 case) - an owner with an aged heartbeat Reverting only the R1 identity clearing made the new stale-identity case fail, first on its precondition and then, with that skipped, because the start path stopped or duplicated the initializing replacement. The launch-agent test file passed. Two runs of the whole fm-remote-job test file each failed early, in different timing-sensitive cases, while the host load average was about 85. Neither failure reached code this change touches. The fd-bound heartbeat check skips without /proc, so that Linux-only behaviour is untested here.Evidence: Duplicate-worker section at target (all pass)
Source: Duplicate-worker section at target (all pass)
Evidence: Same section with R1 identity clear reverted (fails on precondition)
Source: Same section with R1 identity clear reverted (fails on precondition)
Evidence: R1 reverted, precondition skipped: replacement stopped or duplicated
Source: R1 reverted, precondition skipped: replacement stopped or duplicated
Evidence: Launch-agent test file run
Source: Launch-agent test file run
Evidence: Whole-file run 1 (early timing failure under load)
Source: Whole-file run 1 (early timing failure under load)
Evidence: Whole-file run 2 (different early timing failure under load)
Source: Whole-file run 2 (different early timing failure under load)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
🔧 **Rebase** - 3 issues found → auto-fixed ✅
bin/fm-remote-job-lib.sh- merge conflict rebasing onto origin/mainbin/fm-remote-job-worker.sh- merge conflict rebasing onto origin/maintests/fm-remote-job.test.sh- merge conflict rebasing onto origin/main🔧 Fix applied.
✅ Re-checked - no issues remain.
🔧 **Review** - 1 issue found → auto-fixed ✅
bin/fm-remote-job-lib.sh:1463- The required "Preserve previous branch commits and resolved initializing-worker race feedback" remains incomplete. After a crash and code update, worker.identity can retain the predecessor's stale hash. A replacement publishes ownership before replacing that identity at bin/fm-remote-job-worker.sh:246. A concurrent start now accepts this initializing owner at bin/fm-remote-job-lib.sh:1155, but the addedif [ ! -e "$identity" ] && [ ! -L "$identity" ]; then return 0; figuard misses the existing stale identity, so the mismatch terminates the replacement's entire process group. The initialization case at tests/fm-remote-job.test.sh:1670 covers only an absent identity. Clear the predecessor's identity under the newly acquired lock before publishing ownership, and exercise this sequence with a stale identity present.🔧 Fix applied.
✅ Re-checked - no issues remain.
tests/fm-remote-job.test.sh- Two runs of the whole tests/fm-remote-job.test.sh failed in different early timing-sensitive cases ('the active command kept running after an unowned TERM', then 'queue time consumed the second job's execution timeout'). The host load average was about 85 on 18 cores. Neither case exercises the code this change touches, and the duplicate-worker section passes on its own. Remote CI should confirm the whole file.bash tests/fm-remote-job.test.shat 6bb01db (twice; run 1 failed at the unowned-TERM case, run 2 at the queue-timeout case, both under load average ~85)Duplicate-worker section of tests/fm-remote-job.test.sh (fixture setup plus lines 1555-1733) run standalone against the 6bb01db worktree: all 5 cases passSame section against a temp copy of 6bb01db with only the R1 identityrmreverted in bin/fm-remote-job-worker.sh: the stale-identity case fails (precondition, and with the precondition skipped: 'the start path stopped or duplicated the owner before worker.identity publication')bash tests/fm-remote-job-launchagent.test.shat 6bb01db: all pass✅ **Document** - passed
✅ No issues found.
🔧 No changes applied.
1 warning still open:
🔧 No changes applied.
1 warning still open:
✅ **Push** - passed
✅ No issues found.