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

A roll never cuts an in-flight push: the old process stops listening at drain start, not at the end #2040

shipped production is serving it opened this has it

Landed in pull #2051 · run

opened this

src/http/server.ts:1862 serves with reusePort under FORGE_SELF_SWAP; during the handover linger both processes accept (SO_REUSEPORT hashes new connections to both), and the old one ends with web.stop(true), force-closing active connections, so a long git push or clone in flight is cut. Bun's server.stop(false) stops accepting and lets in-flight requests finish (bun.com/docs/runtime/http/server).

Done: at drain start the old process calls stop(false) so new connections go only to the new process, waits for in-flight requests up to the drain budget, then stop(true). A test rolls two forge processes on one data dir with a 30 s push in flight: the push completes, no connection is refused. Part of #1432.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs