]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: sink: add tempo between 2 connection attempts for sft servers
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 21 Feb 2025 09:51:01 +0000 (10:51 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Fri, 21 Feb 2025 10:22:35 +0000 (11:22 +0100)
commit9561b9fb6964af325a10e7128b563114f144a3cb
treee20fcd18b2008a929443ae73e1c6d595de4a9c46
parentc9d41927266849208508b144ef15809a3a15c6cb
BUG/MINOR: sink: add tempo between 2 connection attempts for sft servers

When the connection for sink_forward_{oc}_applet fails or a previous one
is destroyed, the sft->appctx is instantly released.

However process_sink_forward_task(), which may run at any time, iterates
over all known sfts and tries to create sessions for orphan ones.

It means that instantly after sft->appctx is destroyed, a new one will
be created, thus a new connection attempt will be made.

It can be an issue with tcp log-servers or sink servers, because if the
server is unavailable, process_sink_forward() will keep looping without
any temporisation until the applet survives (ie: connection succeeds),
which results in unexpected CPU usage on the threads responsible for
that task.

Instead, we add a tempo logic so that a delay of 1second is applied
between two retries. Of course the initial attempt is not delayed.

This could be backported to all stable versions.
include/haproxy/sink-t.h
src/sink.c