]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stream-int: also update analysers timeouts on activity
authorWilly Tarreau <w@1wt.eu>
Thu, 1 Aug 2019 16:51:38 +0000 (18:51 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 1 Aug 2019 16:58:21 +0000 (18:58 +0200)
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.

src/stream_interface.c

index d3080660935af43c9d7aa3751e027417b396bdc6..cab4371fd42b04a5c1ac69e3045e2c8084f8be5c 100644 (file)
@@ -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)