Give proxies that advertise Connection: close longer to actually close#137
Merged
Conversation
…ctually close The close check polled the socket once ~50ms after the response. Envoy advertises Connection: close but (as a proxy, delayed_close_timeout defaults to ~1s) tears the socket down ~1s later, so it read as still-Open and failed close-expected tests. Now, when the response carries Connection: close, poll up to ~2s (RawTcpClient.WaitForCloseAsync, returns early once closed); keep-alive responses keep the brief 50ms check. Validated locally against Envoy: COMP-CONNECTION-CLOSE flips to pass (close now detected at ~1s), while genuine failures — where Envoy returns 200 keep-alive to malformed input and never advertises close — correctly stay failed.
64bb9a6 to
faa0586
Compare
|
Http11Probe — Compliance Comparison
✅ Baseline PassedCompliance
Smuggling
Malformed Input
Header Normalization
Commit: 933362f |
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.



Problem
The probe checks whether the server closed the socket only ~50 ms after the response (single
Task.Delay(50)+CheckConnectionState()). Envoy advertisesConnection: closebut, as a proxy, tears the socket down slightly later — so it was recorded as still Open and failed every close-expected test. Evidence: all 21 Envoy failures haveconnectionState=Open, 16 on tests where close is an accepted outcome, and Envoy is the only server of 43 that advertises close yet reads Open.Fix
When the response carries
Connection: close, poll up to ~400 ms (RawTcpClient.WaitForCloseAsync, returns early the moment it closes) instead of a single 50 ms snapshot. Keep-alive responses keep the brief check, so the common path stays fast and servers that genuinely ignoreConnection: close(Workerman, Glyph11) still correctly read Open and fail.This is an engine change, so it re-probes all servers — the comment should show Envoy's close-expected fails flipping to pass (confirming timing, not a real Envoy defect). If Envoy stays failed, it was genuine.