mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
BUG/MINOR: stream/cli: fix stream age calculation in "show sess"
The "show sess" command displays the stream's age in synthetic form, and also makes it appear in the long version (show sess all). But that last one uses the wrong origin, it uses accept_date.tv_sec instead of accept_ts (formerly known as tv_accept). This was introduced in 1.4.2 with the long format, with commit 66dc20a17 ("[MINOR] stats socket: add show sess <id> to dump details about a session"), while the code that split the two variables was introduced in 1.3.16 with commit b7f694f20 ("[MEDIUM] implement a monotonic internal clock"). This problem was revealed by recent change ad5a5f677 ("MEDIUM: tree-wide: replace timeval with nanoseconds in tv_accept and tv_request") that made this value report random garbage, and generally emphasized by the fact that in 2.8 the two clocks have sufficiently large an offset for such mistakes to be noticeable early. Arguably a difference between date and accept_date could also make sense, to indicate if the stream had been there for more than 49 days, but this would introduce instabilities for most sockets (including negative times) for extremely rare cases while the goal is essentially to see how much longer than a configured timeout a stream has been there. And that's what other locations (including the short form) provide. This patch could be backported but most users will never notice. In case of backport, tv_accept.tv_sec should be used instead of accept_date.tv_sec.
This commit is contained in:
parent
64a77e3ea5
commit
65efd33c06
@ -3372,7 +3372,7 @@ static int stats_dump_full_strm_to_buffer(struct stconn *sc, struct stream *strm
|
||||
|
||||
chunk_appendf(&trash,
|
||||
" age=%s)\n",
|
||||
human_time(ns_to_sec(now_ns) - strm->logs.accept_date.tv_sec, 1));
|
||||
human_time(ns_to_sec(now_ns) - ns_to_sec(strm->logs.accept_ts), 1));
|
||||
|
||||
if (strm->txn)
|
||||
chunk_appendf(&trash,
|
||||
|
Loading…
x
Reference in New Issue
Block a user