A slot acts on its launchd label or systemd unit only while the service manager holds that name from the slot's own file #188
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/3803-a-run-on-a-runner-host-replaced-the-host"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tracker: #3803
What reached the real agent
Review run 718 (stream 8029) ran one command last, at seq 271, 23:52:07Z. It copied m5's installed
0.3.6/sak-runner, gave it a scratchHOMEandXDG_CONFIG_HOMEwhose configuration named noslotand noservice, and ran it with--slot a. A slot that its configuration'sslotline does not name leaves. Leaving runslaunchctl bootout gui/<uid>/<label>, and with noserviceline the label is the defaultcom.swipelab.sak-runner. launchd'sgui/<uid>domain is one per user, whateverHOMEa process runs with. So the scratch copy booted out m5's own slot a, pid 17272, and runs 715 and 718 lost their pump. The stream ends at that command, because its runner was the process it ended. TherunAH.sharms rantests/runner_launchd.sx, whose labels arecom.swipelab.sak-runner-test-<6>, andmutA.pyonly took two checks out of that test. Neither touched the host's label. The scratch tree, the harness's own transcript and the unified log of that minute were all gone by 2026-10-30, so what bootstrapped the agent again at 23:53:12Z is not recoverable.The same holds for any run: a run's
HOMEis its own directory, sosak-runner --slot atyped in a run reads a configuration that names no slot. It boots out the runner that runs it, andsak-runner --start-slot areplaces it. On Linux,systemctl --useracts on a unit name for everyXDG_CONFIG_HOMEalike, with the same effect.What it delivers
runner/slot.sxasks the service manager which file it holds a slot's name from: thepathoflaunchctl print gui/<uid>/<label>, orsystemctl --user show --property=FragmentPath --value <unit>. A slot acts on the name only when that file is its own, compared with each directory's links resolved, since launchd records the resolved path. A label launchd holds with nopathin its record counts as another install's.--start-slotrefuses a name held from another install's file. It writes nothing and fails with "the service manager holds the slot's name from another install's file". From its own file it starts the slot in place of its process, as before.tests/runner_launchd.sxcheck_other_install: a second scratch install, whose configuration names slot a's label and no slot, as run 718's setup did. Its--slot aand its--start-slot aleave slot a's agent loaded from its plist with the same pid.$HOME, which in a gate is the run's home.check_b_to_a, which used to skip that cleanup and leave the sandbox behind.tests/runner_install.sx: the fake launchctl and systemctl answer the file they hold a name from. On Linux,--start-slotrefuses a unit the manager holds from another file and leaves it running, and a leaving slot does not disable it.tests/runner_handover.sx: the fake systemctl answersshow.check_found_taken's hand-run--slot agets slot a's unit file first, as a process systemd started has it.Regressions, failing before
I ran these from a
git archivearm of master39594b31, with the head's test files anddist/sak-runnerbuilt from master's runner. All ran on m5.tests/runner_launchd.sxfailed:FAIL another install's --slot a, its configuration naming slot a's label and no slot, leaves slot a's agent running from its plistFAIL another install's --start-slot a fails, writing no agent, and slot a's agent runs on as it wasThe other install's leave booted the test's slot a out, so most of the hand-over checks after them fail too: RUNNER LAUNCHD FAIL (22 checks).
tests/runner_install.sxfailed:FAIL ci-linux: another install's --start-slot a fails and writes no unit, sak-runner.service running on from the first install's fileFAIL ci-linux: another install's --slot a, its configuration naming no slot, leaves without disabling sak-runner.serviceIt also failed the three call logs that now open with the manager read:
m5: slot b unloaded itself,ci-linux: slot b unloaded itself, and Linux's install log. That is RUNNER INSTALL FAIL (5 checks).At the head, all three files pass.
Mutation arms of
runner/slot.sxat1b974e05, each failing only what it pins:--slot acheck, then the cascade--start-slot acheck alone/tmp→/private/tmpBefore the null-home fix, master's arm and the leave arm both ended
runner_launchd.sx:195: force-unwrap of a null optional, leaving/tmp/sak-runner_launchd-<6>. With it, master's arm runs to RUNNER LAUNCHD FAIL (22 checks) and removes its sandbox. In every arm the host's owncom.swipelab.sak-runner-bstayed loaded from its plist with the same pid.Gates
On m5:
full(gate run 891) passed at the head,8c1343a8. It covered the setup, the three sx builds,npm run build, all 69tests/*.sxfiles (runner_launchd 112 s, runner_handover 170 s, runner_install 11 s), release.sh with step9, and the deploy contract. The main Playwright config gave 777 passed and 1 skipped, and the runner config gave 10 passed.git archivearm of8c1343a8,tests/run.shpassed runner_launchd (118 s), runner_install (14 s) and runner_handover (186 s).sak-runnerwas run against the host's real labels with a fakelaunchctlfirst on PATH, which passesprintto/bin/launchctland refuses every other subcommand. Its--slot band--start-slot bcalled onlyprint gui/501/com.swipelab.sak-runner-b.--start-slot bexited 1 ("holds the slot's name from another install's file") and wrote no plist. The host'scom.swipelab.sak-runner-bstayed loaded with the same pid. Two more fakes coveredprintitself. One answered a record with nopathline, and--start-slot bwas refused as another install's. The other answered that no such label is held, and--start-slot bwent straight tobootstrapwith nobootout.beba3b26:fast(gate run 881) passed.full(gate run 884) failed onlymemories.spec.ts:315phone-dark, a known race of that shot, and this branch changes no file underweb/.Recovery
This PR changes code only. The recovery the task names had already happened by 2026-10-30, checked on m5 and on the tracker:
runAH.sh96635 no longer exist;launchctl listshows nocom.swipelab.sak-runner-test-*agent;failed · runner_lost.