]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: stream-int: don't wake up for nothing during SI_ST_CON
authorWilly Tarreau <w@1wt.eu>
Thu, 8 Nov 2018 13:32:16 +0000 (14:32 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 8 Nov 2018 13:47:24 +0000 (14:47 +0100)
commitb69f1713af2b7e99c31fc4726c5e1ef0058c9c9c
treefff265c53b1aafbc442a7e2fb474e75b334aec2b
parenta90cacfd70921d597daa540485948e5fb007ea21
BUG/MEDIUM: stream-int: don't wake up for nothing during SI_ST_CON

Commit eafd8ebcf ("MEDIUM: stream-int: call si_cs_process() in
stream_int_update_conn") uncovered a sleeping bug. By calling
si_cs_process() within si_update(), we end up calling stream_int_notify().
We rely on it to update the stream-int before quitting as a hack, but
it happens to immediately wake the task up while the stream int's
state is still SI_ST_CON (during the connection establishment). The
observable effect is that an unreachable server causes haproxy to
use 100% CPU until the connection timeout strikes.

This patch fixes this by not causing the wake up for the SI_ST_CON
state. It would equally be possible to check for states higher than
SI_ST_EST as is done in other places, but for now better stay on the
safe side by covering the only issue that can be triggered. It's
suspected that this issue slightly affects older versions by causing
one extra call to process_stream() during the connection setup for
each activity change on the other side, but this should not have
any observable effect.

No backport is needed.
src/stream_interface.c