Skip to content

docs(keep-alive): add a thorough keep-alive primer#445

Merged
fredbi merged 1 commit into
go-openapi:masterfrom
fredbi:doc/keep-alive-connection-reuse
May 13, 2026
Merged

docs(keep-alive): add a thorough keep-alive primer#445
fredbi merged 1 commit into
go-openapi:masterfrom
fredbi:doc/keep-alive-connection-reuse

Conversation

@fredbi
Copy link
Copy Markdown
Member

@fredbi fredbi commented May 13, 2026

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:

  • 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 #336

Change type

Please select: 🆕 New feature or enhancement|🔧 Bug fix'|📃 Documentation update

Short description

Fixes

Full description

Checklist

  • I have signed all my commits with my name and email (see DCO. This does not require a PGP-signed commit
  • I have rebased and squashed my work, so only one commit remains
  • I have added tests to cover my changes.
  • I have properly enriched go doc comments in code.
  • I have properly documented any breaking change.

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
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.93%. Comparing base (886fc70) to head (ea862bc).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

@fredbi fredbi merged commit 7c678af into go-openapi:master May 13, 2026
18 checks passed
@fredbi fredbi deleted the doc/keep-alive-connection-reuse branch May 13, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant