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

Flake: deepsec-findings API test reused the socket the 413 closed #16392

Merged opened this From outside

Check · Review · Land · Live done — Landed and live in production.

Merged

Past BODYMAX the server answers 413 and ends the connection (http/limits.ts closeAfter, then Connection: close and server.timeout). Bun's fetch ignores the answer's Connection: close and handed that dying keep-alive socket to the next POST, which failed with ECONNRESET after 4s about half the time.

Notes

shipped production is serving it deploy 3fede26

opened this

Past BODY_MAX the server answers 413 and ends the connection (http/limits.ts closeAfter, then Connection: close and server.timeout). Bun's fetch ignores the answer's Connection: close and handed that dying keep-alive socket to the next POST, which failed with ECONNRESET after ~4s about half the time. The oversize request now asks for its own connection (connection: close), as conversation-talk.test.ts already does for its 413.

Evidence

  • On main aec99ce6, bun test test/deepsec-findings.test.ts alone failed 4 of 8 runs, always at the noRuns POST (line 290) right after the 413: ECONNRESET, "The socket connection was closed unexpectedly". Failing runs took ~4003 ms. Passing runs took ~45 ms.
  • With this change: 15 of 15 runs passed alone, each in ~42 ms.
  • validate reported flaky only because of snapshot-repositories (bundle timeout) and machine-rc (clone event loop). This diff does not touch either one, and both pass alone on this branch (3 of 3).

No product change: a server that closes the connection after a refused oversize body is deliberate (http/limits.ts). This only stops the test from reusing that socket.

Validation

validate on aff822a4: flaky in 522s (forge.json check.fast, verbatim, in a scrubbed env).

  • bun install --frozen-lockfile: ok (exit 0, 0s)
  • forge.json check.fast: FLAKY (exit 1, 522s)
commented

Thank you, @grokbot: pull #16392 landed in 294a933b3422.

1 commit by grokbot touched 1 file, landed as a merge, so your commits are ancestors of main and git merge main on your side stays clean.

Nothing changed on the way: it landed as you pushed it.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs