From: Willy Tarreau Date: Thu, 1 Aug 2019 16:51:38 +0000 (+0200) Subject: BUG/MINOR: stream-int: also update analysers timeouts on activity X-Git-Tag: v2.1-dev2~241 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45bcb37f0f8fa1e16dd9358a59dc280a38834dcd;p=thirdparty%2Fhaproxy.git BUG/MINOR: stream-int: also update analysers timeouts on activity Between 1.6 and 1.7, some parts of the stream forwarding process were moved into lower layers and the stream-interface had to keep the stream's task up to date regarding the timeouts. The analyser timeouts were not updated there as it was believed this was not needed during forwarding, but actually there is a case for this which is "option contstats" which periodically triggers the analyser timeout, and this change broke the option in case of sustained traffic (if there is some I/O activity during the same millisecond as the timeout expires, then the update will be missed). This patch simply brings back the analyser expiration updates from process_stream() to stream_int_notify(). It may be backported as far as 1.7, taking care to adjust the fields names if needed. --- diff --git a/src/stream_interface.c b/src/stream_interface.c index d308066093..cab4371fd4 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -553,6 +553,16 @@ static void stream_int_notify(struct stream_interface *si) task->expire = tick_first((tick_is_expired(task->expire, now_ms) ? 0 : task->expire), tick_first(tick_first(ic->rex, ic->wex), tick_first(oc->rex, oc->wex))); + + task->expire = tick_first(task->expire, ic->analyse_exp); + task->expire = tick_first(task->expire, oc->analyse_exp); + + if (si->exp) + task->expire = tick_first(task->expire, si->exp); + + if (sio->exp) + task->expire = tick_first(task->expire, sio->exp); + task_queue(task); } if (ic->flags & CF_READ_ACTIVITY)