ReviewOS

home-lang/home

Bun parity: port fetch abort-signal leak corpus module and lifetime semantics

#337
Closed chris opened this 10 days ago ·
10 days ago

Corpus position 4106, js/web/fetch/abort-signal-leak.test.ts, is currently classified as unsupported module syntax before execution. Port the remaining import shape, then implement and verify Bun-compatible fetch/AbortSignal lifetime and GC behavior with structured abort errors/stacks. Pin the passing fixture and update #66.

10 days ago

Completed in 2f50cc529.

Root cause: the JavaScriptCore Request available to the corpus harness did not expose request.signal. Local Bun.serve handlers therefore threw before registering their request-continuation and abort listeners, leaving the upstream async tests pending.

The port now:

  • loads the real adjacent abort-signal fixture into the corpus module instead of replacing its behavior;
  • gives every server Request a distinct AbortSignal and propagates the client abort reason into it;
  • removes client-signal listeners deterministically on response completion and on exceptional exits;
  • reports invalid signal setup through structured ERR_FETCH_REQUEST_SIGNAL errors with operation, URL, original cause, and composed source stack context;
  • permanently pins js/web/fetch/abort-signal-leak.test.ts in the HTTP/web regression queue.

Verification:

  • upstream position 4106 at the original batchSize = 50 and iterations = 50: 3 passed, 0 failed, 0 todo, 0 unsupported (7,650 local fetch requests);
  • focused linked-signal and structured-error regression: 2 passed;
  • full permanent HTTP/web tail queue: passed;
  • zig fmt --check, git diff --check, and zig build --cache-dir /private/tmp/home-zig-abi-cache: passed.

Closing as complete.

Sign in to comment on this issue.