Files
OmniRoute/open-sse/utils
Diego Rodrigues de Sa e Souza 6912664133 fix(sse): retry direct socket failures on a fresh no-keep-alive dispatcher (#4252) (#4319)
The default direct dispatcher pools keep-alive sockets for up to
fetchKeepAliveTimeoutMs (4s). Edges like nvidia / opencode-zen silently
close idle keep-alive sockets within that window, so the next request
reusing a pooled socket fails with UND_ERR_SOCKET ("other side closed") —
in bursts. proxyFetch retried once, but the retry reused the SAME pooled
dispatcher and could grab another stale socket, then fell through to native
fetch (which also pools) → the job sat in the rate-limit queue until the
30s timeout → 502 + circuit breaker open.

Add getRetryDispatcher() (no keep-alive, no pipelining, mirrors the proxy
dispatcher mitigation) and use it for the retry attempt so it opens a fresh
socket that can't be a dead pooled one. The first attempt still uses the
pooled dispatcher, preserving healthy keep-alive reuse.

Regression test (DI mock) asserts the retry uses getRetryDispatcher(), not
getDefaultDispatcher() (RED before, GREEN after).

Refs #4281 (describeFetchCause diagnostics). Closes #4252
2026-06-19 20:44:07 -03:00
..
2026-06-12 23:49:22 -03:00
2026-06-17 19:26:32 -03:00
2026-06-13 17:27:40 -03:00
2026-05-23 01:46:59 -03:00
2026-06-10 13:49:08 -03:00
2026-05-29 12:44:29 -03:00
2026-06-19 06:49:01 -03:00
2026-05-26 23:51:47 -03:00
2026-06-09 15:56:24 -03:00
2026-06-07 07:20:02 -03:00
2026-06-13 17:27:40 -03:00
2026-06-13 17:27:40 -03:00
2026-06-11 04:01:24 -03:00
2026-06-16 01:00:40 -03:00
2026-05-29 12:44:29 -03:00
2026-06-17 19:26:32 -03:00
2026-06-16 01:00:40 -03:00
2026-06-07 07:20:02 -03:00
2026-06-13 17:27:40 -03:00
2026-06-16 01:00:40 -03:00