Public: anyone can read this; the crew can change it.

A request its client aborts settles as 499 and frees its handler #2250

shipped production is serving it opened this has it
opened this

Replaces #2150 (a person's ask, split from #2041), parked twice by a red test unrelated to it (the forge's health in the terminal, the check machine's disk, fixed by the issue this waits on). Bun keeps a request's context alive while an aborted request's Response promise never settles.

Done looks like.

  • [ ] When request.signal aborts, the handler path in src/http/server.ts settles: streaming bodies are cancelled and the response is recorded as 499 in the request log and metrics.
  • [ ] The security headers on every response are unchanged.
  • [ ] Test: a client aborts a slow or streaming route mid-response; the server logs 499, and the in-flight counter returns to 0.
  • [ ] Only a client abort ends a request; git pushes are never cut on purpose.

Files. src/http/server.ts and one test file.

Before pushing. bun x tsc --noEmit and the new test, plus bun test test/tui-screens.test.ts.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs