]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: mux-fcgi: do not enforce the timeout on connections with streams
authorAleksandar Lazic <al-haproxy@none.at>
Tue, 3 Nov 2026 13:00:00 +0000 (14:00 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 6 Nov 2026 10:10:56 +0000 (11:10 +0100)
commit6e3bad2f32dcc68e76481b4856d509869fa41be1
treeb51ab9be5624aecdea52e82ba556928b0837fb09
parent2e2de896c361e3be61233d19e9d7c8246bdc2645
BUG/MEDIUM: mux-fcgi: do not enforce the timeout on connections with streams

The FCGI connection task is rearmed with "timeout server" on each pass
in fcgi_process(), and fcgi_timeout_task() kills the connection when it
expires, even when streams are still attached to it. With a slow
client, HAProxy stops reading from the FastCGI server once the buffers
are full, so nothing happens on the FCGI connection for a while, and
the connection is killed in the middle of the response. The response is
truncated, the log reports "SD--", and the FastCGI server gets a reset
while it is blocked in write().

Whether the stream waits for the server or for the client is only known
by the stream layer, which already enforces "timeout server" when the
server does not answer. So, as done for the H2 mux by commit c2ea47fb1
("BUG/MEDIUM: mux-h2: do not enforce timeout on long connections", for
GitHub issue #308), the connection timeout is now only enforced when no
stream connector is attached anymore: fcgi_conn_may_expire() mirrors
h2c_may_expire(), fcgi_process() leaves the task unarmed while streams
are attached, and fcgi_timeout_task() does not kill the connection in
this case.

A FastCGI server which does not answer at all still gets a 504 after
"timeout server", reported as "sH--", as before.

This fixes GitHub issue #3558. It should be backported to all supported
versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Aleksandar Lazic <al-haproxy@none.at>
src/mux_fcgi.c