Skip to content

fix(capture): don't close short-first-write TCP conns stalled in the inspectors - #466

Merged
bpalermo merged 1 commit into
mainfrom
fix/capture-inspector-stall
Jul 4, 2026
Merged

bpalermo merged 1 commit into
mainfrom
fix/capture-inspector-stall

Conversation

@bpalermo

@bpalermo bpalermo commented Jul 4, 2026

Copy link
Copy Markdown
Owner

The capture listener's inspectors stall on an inconclusive first write (<6 bytes raw TCP, or server-first protocols that write nothing) → chain selection never runs → Envoy's default 15s listener_filters_timeout closes the conn.

Found chasing a phantom "~4-min new-SA cold start": five probes all flipped at exactly request #100 — the payload p$i crosses to ≥6 bytes at p100. Reproduced live on a steady-state pod: 4-byte first write fails, 6-byte works, same second. SPIRE/SDS/LDS were innocent (<5s each).

Fix: listener_filters_timeout: 1s + continue_on_listener_filters_timeout: true — inconclusive conns proceed to matching, where TCP-service dests still win on the /32 dest-IP tier. At most +1s connect latency for short-first-write/server-first TCP; HTTP/TLS clients never wait. Tests + envoy --mode validate green.

…inspectors

The capture listener's http_inspector/tls_inspector stall on an INCONCLUSIVE
first write: a raw-TCP client whose first chunk is <6 bytes never satisfies the
sniffers, chain selection never runs, and Envoy's default 15s
listener_filters_timeout CLOSES the connection (continue_on defaults false).
Server-first protocols (MySQL-style greeting) would always hit this.

Found chasing a phantom "~4-minute new-SA cold start": five independent probes
all flipped at exactly request #100 — because the probe payload "p$i" crosses
to >=6 bytes at p100. Payloads p1..p99 failed, p100+ worked, on ANY pod at ANY
age (reproduced live: 4-byte write fails, 6-byte works, same pod, same second).
SPIRE entry (<1s), SVID delivery (+4.8s), and LDS (+2s) were all innocent.

Fix: listener_filters_timeout: 1s + continue_on_listener_filters_timeout: true
on the capture listener. Inconclusive conns proceed to chain matching, where a
TCP-service destination still wins on the /32 destination-IP tier (dest IP
outranks every protocol tier) — short-first-write and server-first TCP work
with at most +1s connect latency. Real HTTP/TLS clients send their preface
immediately and never wait. envoy --mode validate green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N7oY7W8oDXrqDzFgoZh25S
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