]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: clock: make time jump corrections a bit more accurate
authorWilly Tarreau <w@1wt.eu>
Thu, 12 Sep 2024 15:58:57 +0000 (17:58 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 12 Sep 2024 16:27:03 +0000 (18:27 +0200)
commitaf48e4cc6b315cadb80d6980586af5c3c8368826
tree32f361c946cea2cdbbabcc29c9e8206f1df634b6
parentad98edd00accdf5529da77eb79b72cf9fc025a7d
BUG/MINOR: clock: make time jump corrections a bit more accurate

Since commit e8b1ad4c2b ("BUG/MEDIUM: clock: also update the date offset
on time jumps") we try to update the now_offet based on the last known
valid date. But if it's off compared to the global_now_ns date shared
by other threads, we'll get the time off a little bit. When this happens,
we should consider the most recent of these dates so that if the global
date was already known to be more recent, we should use it and stick to
it. This will avoid setting too large an offset that could in turn provoke
a larger jump on another thread.

This is related to issue GH #2704.

This can be backported to other branches having the patch above.
src/clock.c