Skip to content
Snippets Groups Projects
Commit 38d6d20a authored by Mike Hibler's avatar Mike Hibler
Browse files

Detect the case where time goes backward and force an event cache update.

If someone resets the clock after bootinfo starts running, then the
time stamp in the cache keeping track of the last time an event was sent
from a node will suddenly be in the (potentially far distant) future
and we will stop sending events for a (potentially long) time.
parent 3344f33b
No related branches found
No related tags found
No related merge requests found
......@@ -246,7 +246,15 @@ bicache_needevent(struct in_addr ipaddr)
info("Timestamps: old:%ld new:%ld\n", oldtt, tt);
}
if (tt - oldtt <= MINEVENTTIME) {
/*
* XXX sanity check, in case time goes backward while we
* are running.
*/
if (tt < oldtt) {
info("%s: Whoa! time went backwards (%ld -> %ld),"
"fixing...\n",
inet_ntoa(ipaddr), oldtt, tt);
} else if (tt - oldtt <= MINEVENTTIME) {
rval = 0;
info("%s: no event will be sent: last:%ld cur:%ld\n",
inet_ntoa(ipaddr), oldtt, tt);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment