BUG/MINOR: stream: fix age calculation in "show sess" output
authorWilly Tarreau <w@1wt.eu>
Thu, 6 Mar 2025 17:56:13 +0000 (18:56 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 13 Mar 2025 15:23:27 +0000 (16:23 +0100)
commita7d85464c04bafabd6fa8eed83a421fe1aa445a6
tree9e1f4fafe52225f14ba46a00dd3c9c989360e102
parentb592285643dcdbb8b8dc3570ab37eaffb4996a25
BUG/MINOR: stream: fix age calculation in "show sess" output

The "show sess" output reports an age that's based on the last byte of
the HTTP request instead of the stream creation date, due to a confusion
between logs->request_ts and the request_date sample fetch function. Most
of the time these are equal except when the request is not yet full for
any reason (e.g. wait-body). This explains why a few "show sess" could
report a few new streams aged by 99 days for example.

Let's perform the correct request timestamp calculation like the sample
fetch function does, by adding t_idle and t_handshake to the accept_ts.
Now the stream's age is correct and can be correctly used with the
"show sess older <age>" variant.

This issue was introduced in 2.9 and the fix can be backported to 3.0.

(cherry picked from commit 1cdf2869f6757946546a2ef102ce822e95de78f8)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 17085371afad2728713a3cc409ce37f2137b27d8)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/stream.c