]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[MEDIUM] implement a monotonic internal clock
authorWilly Tarreau <w@1wt.eu>
Sun, 22 Jun 2008 15:18:02 +0000 (17:18 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 22 Jun 2008 15:18:02 +0000 (17:18 +0200)
commitb7f694f20e2eeb8f9020955bc64b0a55e9d33f50
tree8e2148723150965bd5474fbd7f7757379f3bd3cf
parente5c5ce970ffb11bf0f317f94732ce99b5dc87510
[MEDIUM] implement a monotonic internal clock

If the system date is set backwards while haproxy is running,
some scheduled events are delayed by the amount of time the
clock went backwards. This is particularly problematic on
systems where the date is set at boot, because it seldom
happens that health-checks do not get sent for a few hours.

Before switching to use clock_gettime() on systems which
provide it, we can at least ensure that the clock is not
going backwards and maintain two clocks : the "date" which
represents what the user wants to see (mostly for logs),
and an internal date stored in "now", used for scheduled
events.
15 files changed:
include/common/time.h
include/types/session.h
src/cfgparse.c
src/checks.c
src/client.c
src/ev_epoll.c
src/ev_kqueue.c
src/ev_poll.c
src/ev_select.c
src/ev_sepoll.c
src/haproxy.c
src/log.c
src/proto_http.c
src/proxy.c
src/time.c