You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
the destination Write has no deadline and runs on the poll goroutine — a delivery-path stall freezes COLLECTION (S2) #345
Found by the red-team harness (docs/redteam-plan.md row rt-11-5; findings.md 20261126T014816-1935fd894-1334095).
Mechanism
flushEnvelope (pkg/xtcp/poller.go:150) runs on the poll goroutine and calls dest.Send synchronously; tcpDest.Send (pkg/xtcp/destinations_tcp.go:47) is a blocking conn.Write with no write deadline. A delivery-path stall (ARP blackhole, wedged switch, stalled peer) therefore walks straight up the poll path:
the segments stop landing — delivery dies instantly, silently;
the Writes keep succeeding locally while SO_SNDBUF absorbs envelopes (~10-30 s of them);
the buffer fills → the Write blocks → the whole poller freezes for the TCP retransmit window — no polls, no error counters, nothing delivered, metrics 200;
the freeze: polls frozen over 14 s at tcp_retries2=8, zero error counters, scrape 200 the whole time — fully silent;
de-poison mid-window: the buffered envelopes drain, the catcher catches up (1667 lines/6 s), zero error counters, zero loss — the blind is latency, not loss;
the window closed: counters light up after the silent gap, polls resume, delivery stays dead until a daemon restart.
A privileged co-tenant (CAP_NET_RAW, sibling on the bridge) can hold this state indefinitely with a 200 ms gratuitous-ARP loop; a wedged broker or a switch does it without an attacker.
Fix directions
SetWriteDeadline on the dest conn (a bound, not 15 min), and/or
decouple the flush from the poll goroutine (a queue + worker, like the s3 queue's shape) so a stalled sink delays delivery, not collection.
Expectation flip
When fixed, rt-11-5's phase-1 asserts flip in the same PR (no freeze: polls continue through the stall).
Fixed by PR #348 (with the expectation flip on the row that pinned it).
The tcp destination is now a bounded queue + worker, mirroring the s3parquet queue's shape:
Send never blocks — flushEnvelope hands the marshaled envelope to a bounded envelopeQueue (depth 16 / -tcpQueueDepth, bytes -tcpMaxBufferedBytes, oldest-first eviction, counted in xtcp_tcp_dropped_total), so a wedged sink can never stall the poller again. The freeze is structurally gone.
Every write AND dial carries SetWriteDeadline — tcp_write_timeout (config field 120, validate-bounded to [1s, 1h], default 30 s, -tcpWriteTimeout / TCP_WRITE_TIMEOUT), so a blackholed route costs the timeout, not the ~15.4-min retransmit window.
Measured by the same attack that pinned the bug (rt-11-5, MITIGATED 18/18, evidence 20261126T111738-209ab068a-1688938, XTCP2_TCP_WRITE_TIMEOUT=5s): polls keep issuing through the stall (25→47 over 32 s; pre-fix the poller froze for the whole window with zero counters), the blind is visible and counted while dark (Write/error=9, Dial/error=8, xtcp_tcp_dropped_total=3, scrape 200), and de-poison heals delivery with no daemon restart (reconnects=1, 2498 lines/6 s; second cycle repeats the whole arc).
Correction: the fix landed in PR #352 (not #348 as referenced above — that number went to an unrelated PR in the meantime). The branch is redteam/tcp-dest-queue-worker, commit 55f387519.
Activity
randomizedcoder commentedon Nov 26, 2026
Fixed by PR #348 (with the expectation flip on the row that pinned it).
The tcp destination is now a bounded queue + worker, mirroring the s3parquet queue's shape:
Sendnever blocks —flushEnvelopehands the marshaled envelope to a boundedenvelopeQueue(depth 16 /-tcpQueueDepth, bytes-tcpMaxBufferedBytes, oldest-first eviction, counted inxtcp_tcp_dropped_total), so a wedged sink can never stall the poller again. The freeze is structurally gone.SetWriteDeadline—tcp_write_timeout(config field 120, validate-bounded to [1s, 1h], default 30 s,-tcpWriteTimeout/TCP_WRITE_TIMEOUT), so a blackholed route costs the timeout, not the ~15.4-min retransmit window.Measured by the same attack that pinned the bug (rt-11-5, MITIGATED 18/18, evidence
20261126T111738-209ab068a-1688938,XTCP2_TCP_WRITE_TIMEOUT=5s): polls keep issuing through the stall (25→47 over 32 s; pre-fix the poller froze for the whole window with zero counters), the blind is visible and counted while dark (Write/error=9, Dial/error=8,xtcp_tcp_dropped_total=3, scrape 200), and de-poison heals delivery with no daemon restart (reconnects=1, 2498 lines/6 s; second cycle repeats the whole arc).randomizedcoder commentedon Nov 27, 2026
Correction: the fix landed in PR #352 (not #348 as referenced above — that number went to an unrelated PR in the meantime). The branch is
redteam/tcp-dest-queue-worker, commit55f387519.Merge pull request #352 from randomizedcoder/redteam/tcp-dest-queue-w…