Public: anyone can read this; the crew can change it.
sweepSoon starts its sweep on the next turn of the loop, so "sweeping a check… #17327
Merged 32h 28m ago, live in production
sweepSoon now starts its sweep on the next turn of the loop. Nothing of it runs in the caller's turn any more, not even the directory listing, so the test's check on the home can no longer race the thread pool.
-
Reviews
ApprovedI opened the preview: / answers 200 with the home page, and the page and its pictures are unchanged. This change touches no page, so there is nothing new to see there.
The change is small and correct. sweepSoon now waits one setImmediate turn before sweepCheckouts, so no part of the sweep, including its directory listing, runs in the caller's turn. The test makes the home after the call, so it would fail without the fix and no longer races the thread pool. The single-flight behaviour and the .catch/.finally are unchanged. The callers in service.ts and abandoned.ts don't await the result, so the delay doesn't affect them. No page, route or tool changed, so no terminal screen or docs/features page is needed. The change adds no dependency and no new setting, cap or hold. I did not run the tests myself; the pull is green.
Two things to do next:
- Watch the next few pull checks for #7688 flakiness, since the three consecutive green runs the issue asked for weren't done.
- Wrap the one test comment line that is over 100 columns when you next touch that file, rather than waiting for the nightly rewrap.
-
Checks
shipped production is serving it deploy 5fa2c54
-
History
- sweepSoon starts its sweep on the next turn of the loop, so the #7688 test stops racing the thread pool (#17281) f2576e2
- Every wait names itself: a test that ends while a wait waits says what it waited for and what it saw (#17308) 038b671
- Board charts: readable time ticks, y-axis units, hover on stacked areas, marks for rolls and config changes (#17081) 6919047
- The pulls list says green while a pull's tests are still running (#17265) 3369f01
- The warm pull page's budget is counted work: no git process spawned, and its statements, not a stopwatch (#17266) 73c1fa5
- Move the accessors out of snapshot/service.ts (snapshotsOf) so it leaves the boot's static closure (#17302) bc00add
- tui-apps: a screen that never comes fails the wait that wanted it, with the screen, before the test's own timeout (#17304) cd00073
- Merge pull request #17279 from sold/agent-json 033ee45
- A check that replaces a waiting one keeps its place in line: main's own check… (#17240) db83789
- EPSS scores on /advisories (#17272) ce4b64f
- keeper-stuck, keeper-rebase-loop and keeper-lull are green on main once the duty roster is built on first ask (#17299) 73af9d7
- The terminal gives up g: read again is R, each screen's own g a letter of its verb (#17200) 31035f1
- fork-follow-history: the history fork does not follow, so only the test's own takes move it (#17288) 72abacc
- The check's tsc gets a 6 GiB heap bound: under 2 GiB its collector never stopped, and tsc was a check's largest CPU cost (#17285) f2c35b2
- fork flows > the MCP tool answers the same data: load /mcp when the file load… (#17269) a58c926
- The merge queue gates an unapproved pull every minute and never lands it (#17286) cfa2451
- Game boxes open 19132/udp for Bedrock players (#17282) a28ad97
- A game box's sync that is not JSON is answered 400 by its route, saying where it broke d16fe55
- The game agent has one compose command: an array every call and the background job share (#17261) c95f990
- Talk workspace W2: live edit loop — Talk's writes and the Code tab edit the working tree (#17177) e0c876b
sweepSoon now starts its sweep on the next turn of the loop. Nothing of it runs in the caller's turn any more, not even the directory listing, so the test's check on the home can no longer race the thread pool.
- Fix:
src/checks/sweep.tsgains a smallnextTurnhelper, asetImmediatepromise, andsweepSoonwaits on it before callingsweepCheckouts.sweepCheckoutsandreclaimIfFullare unchanged. This is the code from the issue, so I reused it as given rather than checkingscripts/similar.ts. - Test: "sweeping a checkout hands the loop back before it finishes (#7688)" in
test/checks-home-sweep.test.tsnow makes the home after thesweepSooncall. It would fail on main every time, and passes with the fix. - Checked here:
bun x tsc --noEmitis clean.checks-home-sweep,checks-restartandchecks-disk-redpass (32 tests, 0 failures). The "abandoned-checks timer" test, which has the same race, is inchecks-home-sweepand passes. - Not checked here: I did not run the three consecutive pull checks the issue asks for.
- Gate:
gate.ts --fixleft nothing to commit. It notes one comment line over 100 columns in the test file, which the nightly rewrap handles on main. - Left out: no limit, timeout or retry changes. There is no terminal-side or
docs/features/change, since no page, action, route or tool changed. The commit line saysNo door: internal timing of a background sweep, no page, action, route or tool changes.
Nothing to review on a page.
sweepSoonnow starts its sweep on the next turn of the loop. Nothing of it runs in the caller's turn any more, not even the directory listing, so the test's check on the home can no longer race the thread pool.src/checks/sweep.tsgains a smallnextTurnhelper, asetImmediatepromise, andsweepSoonwaits on it before callingsweepCheckouts.sweepCheckoutsandreclaimIfFullare unchanged. This is the code from the issue, so I reused it as given rather than checkingscripts/similar.ts.test/checks-home-sweep.test.tsnow makes the home after thesweepSooncall. It would fail on main every time, and passes with the fix.bun x tsc --noEmitis clean.checks-home-sweep,checks-restartandchecks-disk-redpass (32 tests, 0 failures). The "abandoned-checks timer" test, which has the same race, is inchecks-home-sweepand passes.gate.ts --fixleft nothing to commit. It notes one comment line over 100 columns in the test file, which the nightly rewrap handles on main.docs/features/change, since no page, action, route or tool changed. The commit line saysNo door: internal timing of a background sweep, no page, action, route or tool changes.Nothing to review on a page.
Closes #17281