BUG/MINOR: mworker: prevent incorrect values in uptime
authorWilliam Lallemand <wlallemand@haproxy.org>
Fri, 17 Feb 2023 15:23:52 +0000 (16:23 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 17 Feb 2023 16:17:28 +0000 (17:17 +0100)
commit5a7f83af84d2a08f69ce1629c7609c98f43411ab
treef2b459b912ea612abe7f89add6ad8909e6c44081
parentfa241939c7ce77014eae2913252e5de21bdaa4d0
BUG/MINOR: mworker: prevent incorrect values in uptime

Since the recent changes on the clocks, now.tv_sec is not to be used
between processes because it's a clock which is local to the process and
does not contain a real unix timestamp.  This patch fixes the issue by
using "data.tv_sec" which is the wall clock instead of "now.tv_sec'.
It prevents having incoherent timestamps.

It also introduces some checks on negatives values in order to never
displays a netative value if it was computed from a wrong value set by a
previous haproxy version.

It must be backported as far as 2.0.
src/haproxy.c
src/mworker.c