docs(keep-alive): add a thorough keep-alive primer#445
Merged
Conversation
Documents the two-things-named-keep-alive problem (HTTP keep-alive vs TCP keepalive vs http.Transport's idle pool) and the proxy / NAT / firewall conntrack gotchas that surface in real cloud deployments (AWS NAT's 350-second idle timeout is the canonical example, sourced from issue go-openapi#336). Structured to be useful to two audiences: - Developers who have just been bitten by `context deadline exceeded` on a quiet client: TL;DR at the top, recipe at the bottom, AWS NAT walked through in between. - Future-them, returning to investigate a related symptom: full treatment of the layered concerns (TCP vs HTTP), Go 1.23's KeepAliveConfig and why the bare KeepAlive field is not enough on Linux, diagnosis hints (httptrace, ss -t -o, tcpdump). Calls out explicitly that `Runtime.EnableConnectionReuse` is a misnomer for body-draining and has nothing to do with TCP keepalive or NAT timeouts — the most common false trail for users searching the codebase for "keep-alive". A future runtime release will either rename it or subsume it into a default-on middleware. Doc lives in docs/ alongside MEDIA_TYPES.md as a sibling reference; will be folded into the doc site (hack/doc-site/) along with the rest of docs/ as that stream catches up. Refs go-openapi#336 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #445 +/- ##
=======================================
Coverage 84.93% 84.93%
=======================================
Files 59 59
Lines 3916 3916
=======================================
Hits 3326 3326
Misses 448 448
Partials 142 142 ☔ View full report in Codecov by Sentry. |
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.
Documents the two-things-named-keep-alive problem (HTTP keep-alive vs TCP keepalive vs http.Transport's idle pool) and the proxy / NAT / firewall conntrack gotchas that surface in real cloud deployments (AWS NAT's 350-second idle timeout is the canonical example, sourced from issue #336).
Structured to be useful to two audiences:
context deadline exceededon a quiet client: TL;DR at the top, recipe at the bottom, AWS NAT walked through in between.Calls out explicitly that
Runtime.EnableConnectionReuseis a misnomer for body-draining and has nothing to do with TCP keepalive or NAT timeouts — the most common false trail for users searching the codebase for "keep-alive". A future runtime release will either rename it or subsume it into a default-on middleware.Doc lives in docs/ alongside MEDIA_TYPES.md as a sibling reference; will be folded into the doc site (hack/doc-site/) along with the rest of docs/ as that stream catches up.
Refs #336
Change type
Please select: 🆕 New feature or enhancement|🔧 Bug fix'|📃 Documentation update
Short description
Fixes
Full description
Checklist