server: report why connections failed; Windows fd-exhaustion pause; review follow-ups - #310
Merged
Merged
Conversation
`ConnectionClosed::error()` (and `error_arc()`, an owned `SharedSource`) returns the error behind `CloseReason::Error`, and also an error hit while a connection drained, whose reason stays the one that started the drain. Metrics can now tell error kinds apart and count failed drains. A panic in a connection-extensions function is reported the same way. hyper-util ends a connection told to wind down before it picked a protocol with an `Interrupted` "Cancelled" error; that is a clean close, so `error()` stays `None` for it. The workspace hyper-util floor is 0.1.20, the version this was checked against. `ConnectionClosed` keeps `UnwindSafe` / `RefUnwindSafe`, which the boxed error would otherwise remove; a test now pins those traits for it, and for `BoundServer` without TLS. Also adds tests that request-count and idle retirement close an undrained connection after the configured grace period, not the default. Signed-off-by: Iain McGinniss <309153+iainmcgin@users.noreply.github.com>
The accept loop's pause after running out of file descriptors matched only `EMFILE` / `ENFILE`, which Winsock never returns; it reports `WSAEMFILE` (10024), so the pause never applied on Windows. The serve methods now say which accept errors are transient, that dropping the future aborts live connections, and what any other accept error does to them; `serve_with_service` no longer suggests it accepts a tower-layered service. The module docs say serving needs a runtime with time enabled: the default header-read timeout already required it, and the pause uses the same timer. The changelog entry that joined the idle-reaping and file-descriptor fixes is split in two. Signed-off-by: Iain McGinniss <309153+iainmcgin@users.noreply.github.com>
…e loop - The guide's custom accept loop sets TCP_NODELAY as the built-in loop does, logs a socket that fails to move between runtimes instead of dropping it silently, records whether a connection failed, and says to pause after running out of file descriptors. - A compile_fail doctest, with a compiling counterpart test, pins that the connection-extensions function sees `ConnectionInfo` read-only; the private alias behind it is renamed to say what it holds. - `connectrpc::http` re-exports the `http` crate, whose `Extensions` the connection-extensions function takes. - The workspace h2 floor is 0.4.15, the first release that sends GOAWAY on a header list far over the limit, which the header-list-size tests expect. Signed-off-by: Iain McGinniss <309153+iainmcgin@users.noreply.github.com>
iainmcgin
marked this pull request as ready for review
September 21, 2026 00:49
iainmcgin
enabled auto-merge
September 21, 2026 00:49
rpb-ant
approved these changes
Sep 21, 2026
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.
Follow-ups deferred from the connection-layering stack (#306, #307, #308, #304).
ConnectionClosed::error()/error_arc()return the error that ended a connection: always forCloseReason::Error, and for a failure while draining, whose reason stays the one that started the drain. A connection told to wind down before it picked a protocol reports no error: hyper-util returns anInterrupted"Cancelled" error there, which is matched by kind and message, so the workspace hyper-util floor is now 0.1.20 (checked against 0.1.19 and 0.1.20).ConnectionClosedkeepsUnwindSafe/RefUnwindSafethrough manual impls.WSAEMFILE; before, the pause never applied on Windows.connectrpc::httpre-exports thehttpcrate, since the connection-extensions function takeshttp::Extensions.