Repository navigation
Conversation
- A pooled keep-alive connection that the gateway closed while it sat idle failed the next request before any response byte arrived, and fx showed "Network interrupted" on a healthy network. fx now sends that request once more on a fresh connection and shows nothing. - Only a reused connection that fails while sending, or while reading the response head before any head byte, qualifies. A fresh connection that fails, a response that had started, cancellation, and a wake from sleep are reported as before. - `HttpPool.openRequest` takes the idle connection itself so it can report reuse, and the resend closes the origin's other idle connections first so it dials fresh. - The connection fx warms at launch counts as reused, so a warm connection the gateway reset also heals silently. The peer-reset test now resets two connections, so its second reset still lands on a fresh connection that fx reports.
- A request deadline cancels the socket read or write in place, and std reports it as an ordinary read or write failure. On a reused connection with no response bytes, that looked like a connection the gateway had closed, so the request went out again after the caller gave up. A failure now counts as a closed connection only when the socket says the peer closed it, or the head read ends cleanly. - A head failure also counts only within five seconds of the send and only when no response byte arrived, including an incomplete TLS record that is still undecrypted. - The E2E test counts only connections that carried a request, so an unused warm-up connection cannot change its result.
- Time the five-second head window on the boot clock, so a laptop that slept after the send cannot make a late failure look like a quick one. - Trace the stage, the socket's own error, the received bytes, and the elapsed time for every failure on a reused connection, whether fx resends it or reports it. - Note that a connection std reuses after another request released it counts as fresh, so its failures are reported.
- Add a loopback test where the gateway starts the response head on a reused connection and then resets it. The request is reported, not resent, and this is the only test where the received-bytes check decides. - Count the socket buffer only for TLS, where it can hold an undecrypted record. Plain HTTP reads that buffer directly, so the trace counted its bytes twice. - Trace received bytes and elapsed time only for head failures, where they are measured.
- Set FX_SOUND=0 for the fx processes the closed pooled connection E2E test starts, as tests that spawn fx directly must. - Require ReadFailed in the reset-after-head test, so a resend that fails fast cannot pass it.
fazxes
marked this pull request as ready for review
October 17, 2026 09:01
…pooled-connections
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary