You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ui-sdk: an aborted maintenance launch can settle while its three FIFO descriptors are still open #2862
packages/ui-sdk/tests/worker-pipes.test.ts "an abort accepted while a maintenance launch awaits its FIFOs stops the worker and releases every pipe" (added by #2845) failed once on main at 6f3f65fd1 (CI unit shard 3, job 121011963865) and passed on the next commit 1f032f95:
The launch rejected with the abort and the FIFO directory was removed, but this process still held all three FIFO descriptors when runMaintenanceWorker settled. Either the refusal settles before the descriptor close it started has finished, or an open that was in flight when the abort landed completes after cleanup and is never closed. The second is a real descriptor leak on the hosted server under abort, not only a test race.
Acceptance criteria
Find which of the two causes it is, with a receipt (for example a forced delay on the FIFO open or close path that makes the test fail on every run).
A launch aborted while its FIFOs are created or opened settles only after every FIFO descriptor it opened is closed; no open that completes after the abort leaks.
ABORT_DURING_FIFOS_RELEASES_PIPES passes under that forced delay, and a mutation that drops the close fails it on the same assertion.
Do not loosen the test (no retry, no wait-for-descriptors-to-disappear loop in the test) unless criterion 1 proves the leak is in the test fixture rather than in the launch.
Claimed for 0.44.0. Branch: fix/2862-abort-fifo-descriptors-044.
Cause, from a receipt: neither of the two in the body. Bun's file stream and sink (fifoStream, Bun.file(fd).writer()) each F_DUPFD_CLOEXEC the FIFO descriptor on the JS thread. Bun then closes the duplicate on one of its pool threads after the stream ends (strace: the close comes from a different TID), and a caller has nothing to await. When the pool is busy, runMaintenanceWorker settles while all three duplicates are still open, and that is the CI signature. Holding the pool with parked FIFO reads reproduces the failure 5 times out of 5. The descriptors do close once the pool frees, so this is late, not a permanent leak.
Activity
schlessera commentedon Oct 24, 2026
Claimed for 0.44.0. Branch:
fix/2862-abort-fifo-descriptors-044.Cause, from a receipt: neither of the two in the body. Bun's file stream and sink (
fifoStream,Bun.file(fd).writer()) eachF_DUPFD_CLOEXECthe FIFO descriptor on the JS thread. Bun then closes the duplicate on one of its pool threads after the stream ends (strace: the close comes from a different TID), and a caller has nothing to await. When the pool is busy,runMaintenanceWorkersettles while all three duplicates are still open, and that is the CI signature. Holding the pool with parked FIFO reads reproduces the failure 5 times out of 5. The descriptors do close once the pool frees, so this is late, not a permanent leak.fix(ui-sdk): refuse a result aborted while its pipes close; checkpoin…
fix(ui-sdk): settle a maintenance run only after its FIFO descriptors…
fix(ui-server,backends): settle agent turns and streaming launches af…
fix(ui-server,backends): settle agent turns and streaming launches af…
fix(ui-server,backends): settle agent turns and streaming launches af…