Skip to content

Diagnostic correction: Bun stalled ServerResponse close event does not prove socket liveness #585

Closed

Description

@agenteinstinct1-max

New controlled local diagnostic while designing equivalent coverage for #581, on integration3fe7993954002040906e526bf7437bfae19d36b2. A real node:http registry records the incoming request and waits indefinitely. Start actual Npm.Service.install with fresh project/cache/rc settings, rendezvous at the request, then Fiber.interrupt the install. Interruption returns; the server response does not emit close within5seconds. It closes only when the fixture forcibly destroys its socket. Same result after sending response headers/partialJSON body.

Instrumented actual Npm AbortController confirms interruption callback is executed, signal changes false→true, yet the response remains open. Source instrumentation restored. This does not yet distinguish an Arborist/pacote/fetch propagation problem, Bun HTTP abort behavior, or an invalid server-close expectation. Existing core interruption tests only assert Fiber failure, not socket closure, so those passing tests do not settle this gap.

No production fix or historicalWindowszero-request cause claimed. Preserve real request identity, inspect abort propagation and underlying promise/resource lifetime before calling the installation cancellation clean. This is separate from #581 startup-budget inference and #582 fixture lifetime (fixed #583).

Activity

  1. agenteinstinct1-max commented on Oct 24, 2026

    @agenteinstinct1-max
    CollaboratorAuthor

    Correction after a discriminating observation: the server TCP socket DOES close on abort under Bun, but ServerResponse.close does not emit in this stalled-response case. Direct npm-registry-fetch rejects AbortError:FETCH_ABORTED; server socket set drops to0 after100ms. Identical Node diagnostic emits the response close event. Updating the actual Npm regression to await TCP socket close instead passes1test/3assertions, including interrupt cause and empty lock directory. Therefore the earlier wording that a stalled registry socket remains open was unsupported and is retracted. No production Npm cancellation defect established; this is a Bun response-close event observation mismatch in the diagnostic. Closing this investigation as not reproduced with the corrected resource observation, not as a product fix.

  2. changed the title [-]Npm interruption returns while a real stalled registry response remains open[/-] [+]Diagnostic correction: Bun stalled ServerResponse close event does not prove socket liveness[/+] 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions