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
Drain readable PROXY protocol bytes before handling a client half-close #1823
On Linux, final request bytes and EPOLLRDHUP can arrive as one READABLE|HUP event after the client calls shutdown(SHUT_WR). TcpSession::ready_inner handles frontend HUP before readable data (ordering); front_hup closes every pre-pipe state other than SNI preread (handler). ExpectProxyProtocol::readable would parse the complete header and upgrade the session (parser), but it never runs.
The retained Linux regression queues a complete PROXY-v2 header plus payload, half-closes the client write side, observes the real epoll READABLE|HUP event, and expects the backend to receive the payload and the client to receive the response:
mise exec [email protected] -- cargo test -p sozu-lib expect_proxy_half_close_drains_payload_and_returns_response -j4 -- --nocapture
It fails before backend dial because the session closes. The reported panic is the test assertion; no Sōzu server panic was observed.
Acceptance: when readable bytes and a read-half close are coalesced, drain/parse the readable direction before final close handling, preserve the response half while work remains, and retain coverage for zero-byte bare PROXY health checks.
Evidence scope: runtime checks used 8ed38435c6e80dc374de421116d8b145f1e5ce6a; the relevant production paths were independently checked at bd19a78e2831fa9b3bc099eff96359f1bd457958 on 2026-10-03. This issue tracks lifecycle behavior and regression coverage.
#1836 fixes the PROXY-v2 header being dropped when its bytes and the client's half-close arrive in one READABLE | HUP event, for both TCP and the HTTP/HTTPS expect stage. It does not deliver the backend response after the half-close: the TCP pipe closes once the request is flushed (Pipe::check_connections, lib/src/protocol/pipe.rs), for every TCP session, PROXY protocol or not. That policy question is tracked in #1840.
Activity
docs(proxy-protocol): state the health-check logging change and softe…
FlorentinDUBOIS commentedon Oct 3, 2026
#1836 fixes the PROXY-v2 header being dropped when its bytes and the client's half-close arrive in one
READABLE | HUPevent, for both TCP and the HTTP/HTTPS expect stage. It does not deliver the backend response after the half-close: the TCP pipe closes once the request is flushed (Pipe::check_connections,lib/src/protocol/pipe.rs), for every TCP session, PROXY protocol or not. That policy question is tracked in #1840.fix(proxy-protocol): drain a PROXY-v2 header coalesced with the clien…
fix(tcp): connect-timeout accounting, expect-proxy timer, SNI preread…