Repository navigation
Description
Context
The 2026-11-16 reproduction comment supplies deterministic fixture-ordering evidence. The original natural failure retained limited diagnostics; that historical limitation remains.
In a whole-repository bun test run on a 4-CPU VM (Ubuntu 24.04, Bun 1.4.2) at main 631bbae2c on 2026-11-13, an abort that lands while a finished maintenance command's pipes close still refuses its result failed after 238 ms with error: ABORT_DURING_RELEASE_REFUSES ("ABORT_DURING_RELEASE_REFUSES", packages/ui-sdk/tests/worker-pipes.test.ts:195). The awaited run was not a DOMException; the run kept only the one-line failure, so what it was instead is not known.
The case orders its race with timers: it holds the work pool, and once the command's outputs have ended it aborts after 50 ms and releases the pool 200 ms later (test, packages/ui-sdk/tests/worker-pipes.test.ts:181-201). It passes its own tempDomain, so the shared maintenance ledger from #3019 does not reach it. A foreign holder of that ledger was live during the run all the same.
What was tried
- The file alone on that VM, with and without the foreign holder: passes.
- 2026-11-14, local host (16 CPUs, Bun 1.4.4), main
631bbae2c: 40 runs of the file beside 16 busy loops, 0 failures. - The case's name appears in 9 of the 84 failed-job logs on main
CIfrom 2026-10-28 to 2026-11-13, always as a pass.
Scope
Find out what the run resolved to when the assertion failed, and whether the pool hold can lapse before the abort lands (for example when the process's work pool is busy with other files' work late in a long run).
Out of scope
Lengthening the 50 ms or 200 ms waits, retries, or weakening the refusal and pipe-release assertions.
Acceptance criteria
- A failing run records the actual resolved value or exception and the order of command completion, pipe release, abort and pool release, with SHA/runtime/host conditions. Alternatively, a controlled ordering demonstrates the result being accepted before the abort.
- The evidence distinguishes an expired pool hold or fixture ordering error from a production refusal defect; unrelated ledger contention is not assumed to be causal.
- Any resulting correction preserves refusal after an abort that wins the race, has a named failing-first/restored receipt and passes the focused suite without longer timers or retries.
The 2026-11-16 controlled run meets the evidence criterion: foreign work can overtake the queued pool hold, returning the maintenance result before the timed abort. The production abort refusal holds when the abort wins. Correct only this fixture's ordering: retain a real descriptor on the worker FIFO before its stream starts, await output EOF, abort while that descriptor is still held, then release it and await the result. This removes the timer/pool-scheduling assumption and exercises the real descriptor-release path. Keep the other work-pool coverage and production refusal unchanged.
Verification
bun run test packages/ui-sdk/tests/worker-pipes.test.tsContract impact
None.
Found during the needs: repro triage of 2026-11-13.
Bounded control — 2026-11-14
At main faa480e8c864d547cd8b4eb75965b7d609284770, Ubuntu 26.04.1, 16 CPUs, Bun 1.4.4, bun run test packages/ui-sdk/tests/worker-pipes.test.ts packages/ui-server/tests/external-speech.test.ts passed 30 tests / 118 assertions / zero failures in 12.19 seconds, with the repository preload intact. This is one current-source control, not the reported Ubuntu 24.04 / 4-CPU / Bun 1.4.2 long-run condition and not a causal repair. An initial attempt before workspace dependency installation failed module loading; it is excluded from behavioral evidence.
2026-11-14 triage at main faa480e8c864d547cd8b4eb75965b7d609284770: Replaced the empty acceptance section with the existing investigation's checkable evidence and correction criteria; needs: repro remains.
2026-11-16 readiness reconciliation: folded the reproduced fixture attribution and scoped deterministic correction into the body. This explicit work request covers the fixture repair; no new product or contract policy is implied.
Activity
schlessera commentedon Nov 16, 2026
Reproduction — 2026-11-16
Three agents on different models worked this independently, then cross-reviewed each other's write-ups. All three converged on a test-fixture ordering bug, not a production defect.
holdWorkPoolqueues its blocking reads but never confirms that each pool thread has taken one. Pool work still in flight when the hold is placed can then run Bun's later descriptor close ahead of the queued hold reads.released()resolves before the abort, and the result is accepted.The forcing below reproduces the sighting on every run, and its controls never do. Removing
needs: repro.The production refusal itself looked correct. One separate production question surfaced during this work and is filed as #4078: an unreadable descriptor table counts as released. It is very unlikely to be the cause here.
Forcing reproduction for #3995. The pool hold is overtaken by foreign pool work, and the
result is accepted before the abort.
Requirements: Linux with
mkfifo,taskset(util-linux), and bubblewrap able to create user,mount and network namespaces, as for any maintenance-worker test; Bun 1.4.2 or 1.4.4. No
network and no API key.
force-3995.diffchanges only the test, never production code. Before the launch it occupiesevery Bun pool thread with a blocking read on a private FIFO. Once the command's outputs have
ended, it frees those threads one at a time inside the 50 ms before the case's abort.
Run (
taskset -c 0-3gives a 4-thread pool like the 4-CPU host where it was seen):Observed at
017af32f9, on Bun 1.4.2 and on 1.4.4:Every failure is:
Each failure settles in about 90 ms, below the about 320 ms a refusing run needs.
Received value: undefinedis the success branch of the test'srefusal()helper: the runreturned
{stdout: "ithaca", exitCode: 0, killed: false}before the abort. With only 3 of4 pool threads busy, the hit rate falls to between 0 and about 1 in 3 per batch of 10, and
only on later iterations in a process.
Reading:
holdWorkPool(packages/ui-sdk/tests/helpers/work-pool.ts) queues its blockingreads but never confirms that every pool thread is parked on them. Pool work already in flight
can finish and take Bun's later-queued duplicate-descriptor close first, so
fifosReleased(packages/ui-sdk/src/server/worker-pipes.ts) resolves before the abort.runMaintenanceWorkerthen rightly returns the result, since the abort has not landed yet. The"freed after the abort" control refuses every time, which shows the production refusal holds
whenever the abort wins.
schlessera commentedon Nov 16, 2026
Claimed for implementation. Claim token:
claim-8010b2aa. Branch:test/4005-nested-runtime-prerequisite.Explicitly requested batch with #4005 and #3998. Closure-only overlaps include #4080; no direct path collision reported.
schlessera commentedon Nov 16, 2026
Implementation and readiness reconciliation — 2026-11-16. The body now incorporates the reproduction and scoped correction previously held in comments. The requested batch is implemented in #4084, head
bb23e28df83c3afa1edbb982cbdd1ecbd7d16ca5, based on3b104890f84e2eeca687d3c4fbdd1dbb02fb3ae9.The four-CPU foreign-work forcing fails the original abort assertion. Holding a real extra FIFO reader orders EOF, abort and release without timers. The corrected full file passes 6 tests / 22 assertions; 20 four-CPU iterations pass. Removing the production post-release abort check fails ABORT_DURING_RELEASE_REFUSES; the production source is restored and unchanged in the PR.
Local
bun run check:pr --base origin/mainpasses all gates and 1,208 affected fast tests. Root typecheck passes with an 8 GB V8 heap. PR and issue milestones are verified as 0.45.0. The PR stays draft while existing main incident #4081 blocks ordinary candidate confirmation; merge and closure are not yet claimed.test: stabilize worker and session fixtures and expose runtime prereq…
schlessera commentedon Nov 16, 2026
Merged in #4084 as
ad3611ae15f3af82eba14ac9aaf4a8727b3920eb, verified as an ancestor oforigin/main. Candidate run 43873943931, attempt 1, passes all selected fast jobs and proof; the selected job checkout logs identify620cbd8eab58f34272ee7f294e4e19d38a82d02c, whose tree exactly matches the squash. The issue is closed and retains milestone 0.45.0, as does the PR.Local failing-first and restored-mutation evidence remains in the PR. Required proof on the actual squash is still running in main run 43877725319; full post-merge verification is not yet claimed.