A run waits on the background tasks its turn leaves running, and is told to write its report before a server holds it #128
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/3687-a-run-whose-turn-ends-while-its-backgrou"
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: #3687
A run whose turn ended while its own background tasks ran was killed
idle_timeout15 minutes later with no report, as review run 343 was (stream 7547): the session stayed up only for its tasks' turns, and a silent bench or a server that never ends gave it none within the idle cap.What the PR delivers:
background_tasks_changedline, the whole set on each line, keeping each task's description.$SAK_REPORTwritten ends the rundonethrough SIGTERM to the harness's group, which also ends a task still running, such as a server.What it leaves: an agent that ignores the line and ends its turn again without the report, while only a server runs, is still held to the wall cap.
Regressions, both runner_core checks on the stub stream-json harness:
check_background_wait: the stub's turn leaves a server and a bench running; the bench ends silently after 3 s, past the check's 1.5 s idle cap, and the turn its notification opens writes the report while the server runs on. Fail-before with master 3ecd9d1's runner/: the run endskilled · idle_timeout1 s after it starts, RUNNER CORE FAIL (1 checks).check_server_report: the stub's first turn ends with only a server listed and no report; on the runner's line it writes the report, ends its turn and stays up, as it also does when its stdin closes instead. The check asserts the stream holds the line naming the server, the stream isdonewith the report's summary and the run isdone, under a 10 s wall cap. Fail-before with c3bd8a7's runner files and this PR's tests (gate cache sx 300086027f): the run endskilled · wall_timeout10 s after it starts, and the check FAILs. In the same run,check_wakeupandcheck_background_waitFAILexit_status, because their stub modes now wait for the runner's line before they read to the end of their input. RUNNER CORE FAIL (3 checks). At7170f5ball three pass.The stub's
wakeupandbenchmodes answer the runner's line with a turn of their own, and their listed tasks carry adescriptionas the real line's do.check_wakeupcounts three turns now: the first, the one the line opens and the one the task's notification opens.No golden is added or changed.
It also carries
fa0995c, "A silent tail's heartbeat follows the clock, not its count of polls" (src/api.sx), the same patch asec78bdeon #3721's branch and the fix of #3734. Agra chose to carry it here after the flow's gate step failedfulltwice at7170f5bon m5 on onestep_concurrency.sxcheck alone (jobs 74 and 80, below). A tail sent its: tickheartbeat every ten polls, counting each poll asPOLL_MS. A poll is a 100 ms sleep plus three reads, and on a runner whose timers the system stretches, that sleep takes 100–250 ms. So the heartbeat came every 2.3–2.4 s, and a dropped tail kept renewing its slot past the check's fixed wait of one heartbeat plus the lease plus 1 s. The tail now sends the heartbeat onceHEARTBEAT_MShas passed on the clock since it last sent framing, as docs/api.md describes the heartbeat. Whichever of this PR and #3721's lands second merges the patch cleanly.Its regression is that
step_concurrency.sxcheck, "the slot a dropped tail left behind is handed on once its lease lapses", run by hand with the gate cache's sx (300086027f) fromgit archivecopies outside the checkout, the two arms side by side:7170f5bfailed the check 3 of 3;7170f5bwith ec78bde'ssrc/api.sxpassed 3 of 3 (CONCURRENCY OK).UserIsActive 0; 20 × 100 ms sleeps took 114/208/250 ms min/avg/max):7170f5bfailed the check 2 of 8, each time with the reclaiming tail refused 503 "every held slot is taken";fa0995cpassed 8 of 8.Gates at the head
fa0995c:fullgate run 262 (this run's #1, 05:53–06:19 EEST) failed only on threestep9_release.sxinstall.sh checks, withenv: Support/JetBrains/Toolbox/scripts: No such file or directory: s32's run PATH holds a directory with a space, and the test passes$PATHtoenvunquoted. Every step before it passed: both builds,npm run buildwith the web suite 390/390, the libc grep, and the wholetests/*.sxsuite,step_concurrencyandrunner_coreincluded.scripts/release.shitself passed, its web suite 390/390 too. The steps after it did not run.scripts/release.shpassed,step9_release.sxpassed (STEP9 OK, 39 ok), and the deploy contract passed. The runner Playwright config passed 10 of 10, on port 18978 for that one run, because an orphanedsak serve(pid 6685, left by run 75 on 2026-10-21) still holds 18988 on s32. The main Playwright config's first run (06:24–06:31, 6.8 min against its usual 3.6, with another run's gate starting halfway through it) failed 13 goldens: the eleven stream goldens whose hidden clocks move with a slow run (streams.spec.ts:1192, :1292 ×4, :1341, :1360 andtail-stream.spec.ts:157 ×4), and twoaccounts.spec.tslight sign-in shots by 79 pixels each. Run again with nothing changed (06:32–06:37, 4.5 min), it passed: 723 passed, 1 skipped. This PR changes nothing underweb/.Gates at
7170f5b, beforefa0995c:fullgate run 1 failed at the release step. Every step before it passed: both builds,npm run buildwith the web suite 390/390, the libc grep, and the wholetests/*.sxsuite,runner_corewith both checks included. The release step's own web suite then failed 2 of 390:NavigatorRoute.test.ts"shows the counts of the loaded tracker" (awaitFor) andforce.test.ts"spaces the anchors after an in-session grow…" (timed out in 5000 ms).fullgate runs 2, 3 and 4 each failed atnpm run buildon the same two tests. Another run on s32 ran a WebKit bench through all four, holding the one-minute load at 6–13. This PR touches nothing underweb/, which is identical to master's (fullgate 213 passed with it atc3bd8a7). Alone, the two tests pass in 2.4 s. By hand, under the same load, the whole web suite failed 1 test with the default workers and passed 390/390 with--maxWorkers=4.tests/*.sxstep on one check:step_concurrency.sx"the slot a dropped tail left behind is handed on once its lease lapses". Every step before it passed, the web suite 390/390 included, and so did every other test file. That file imports onlysrc/, which this PR does not touch. Run by hand on m5 at 03:15 at the same head, the file passed (CONCURRENCY OK). The same check failed on m5 from 01:56 to 02:50 that night on another branch, and with master 3ecd9d1'ssrc/swapped in.fullgate run 1 of run 441 passed at7170f5b(03:29–03:54 EEST): both builds,npm run buildwith the web suite 390/390, the libc grep, the wholetests/*.sxsuite withstep_concurrencyandrunner_coreincluded, release withstep9_release, the deploy contract, the main Playwright config (723 passed, 1 skipped) and the runner config (10 passed).step_concurrency.sxcheck alone. Every step before it and every other test file passed, and the steps after it did not run. It is task #3734: at master the tail counts its idle polls asPOLL_MSeach, and m5's 100 ms sleeps took 132–250 ms (average about 235 ms) at 05:00, so a dropped tail renews its slot past the check's fixed wait. The fix,ec78bde("A silent tail's heartbeat follows the clock, not its count of polls"), is on #3721's branch, not on master.fullgate run 256 (run 461's #1, 05:02–05:18 EEST) failed the same way at7170f5b. Every step beforetests/*.sxpassed, the web suite 390/390 included, andstep_concurrency.sxwas the only failing file there. The steps after it did not run. By hand at 05:01 fromgit archivecopies of7170f5b, run side by side with the gate cache's sx, the file failed this check 3 of 3 as it is and passed 3 of 3 (CONCURRENCY OK) with ec78bde'ssrc/api.sxapplied.A run waits on the background tasks its turn leaves running, and the turn that writes its report ends itto A run waits on the background tasks its turn leaves running, and is told to write its report before a server holds it