BUG/MEDIUM: stconn: Don't update stream expiration date if already expired
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 9 Nov 2023 08:54:51 +0000 (09:54 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 9 Nov 2023 11:08:59 +0000 (12:08 +0100)
commit78021ee9ef31dfb7055701b712694feecef238e3
tree5988062bfa4146d38d38c6802360caa3d98de732
parent0016dbaef40e734aef520817ee930e67c3fa784f
BUG/MEDIUM: stconn: Don't update stream expiration date if already expired

The commit 08d7169f4 ("MINOR: stconn: Don't queue stream task in past in
sc_notify()") tried to fix issues with epiration date set in past for the
stream in sc_notify(). However it remains some cases where the stream
expiration date may already be expired before recomputing it. This happens
when an event is reported by the mux exactly when a timeout is triggered. In
this case, depending on the scheduling, the SC may be woken up before the
stream. For these cases, we fall into the BUG_ON() preventing to queue in
the past.

So, it remains unexpected to queue a task in the past. The BUG_ON() is
correct at this place. We must just avoid to recompute the stream expiration
date if it is already expired. At worst, the stream will be woken up for
nothing. But it is not really a big deal because it will only happen on
timeouts from time to time. It is so sporadic that we can ignore it from a
performance point of view.

This patch must be backpoted to 2.8. Be careful to remove the BUG_ON() on
the 2.8.
src/stconn.c