Skip to content

ui-sdk: an aborted maintenance launch can settle while its three FIFO descriptors are still open #2862

Closed

Description

@schlessera

What happens

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:

error: ABORT_DURING_FIFOS_RELEASES_PIPES
-   "descriptors": [],
+   "descriptors": [
+     "/tmp/worker-pipes-owned-…/brain-worker-pipes-…/stdout (deleted)",
+     "/tmp/worker-pipes-owned-…/brain-worker-pipes-…/stderr (deleted)",
+     "/tmp/worker-pipes-owned-…/brain-worker-pipes-…/stdin (deleted)",
+   ],

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

  1. 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).
  2. 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.
  3. ABORT_DURING_FIFOS_RELEASES_PIPES passes under that forced delay, and a mutation that drops the close fails it on the same assertion.
  4. 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.

Activity

  1. added this to the 0.44.0 milestone on Oct 24, 2026
  2. added
    type: fixSomething is broken and must behave the way it is documented.
    area: ui-sdkWire protocol, runtime schemas, the server and client SDK surfaces.
    priority: p1Scheduled into the current or next milestone.
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    on Oct 24, 2026
  3. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    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.

  4. self-assigned this
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-sdkWire protocol, runtime schemas, the server and client SDK surfaces.priority: p1Scheduled into the current or next milestone.type: fixSomething is broken and must behave the way it is documented.

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions