[4.1] 4f58bb8 Allow up to clock_step error when checking the session timestamps
PÃ¥l Hermunn Johansen
hermunn at varnish-software.com
Wed Nov 16 13:55:05 CET 2016
commit 4f58bb832a65dce60cedbeccd07cae917b58361f
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date: Thu Oct 27 14:59:17 2016 +0200
Allow up to clock_step error when checking the session timestamps
When checking the timestamps on deleting a session, allow up to
clock_step seconds error before bailing.
Fixes: #1874
diff --git a/bin/varnishd/cache/cache_session.c b/bin/varnishd/cache/cache_session.c
index b5be7ea..0e2a746 100644
--- a/bin/varnishd/cache/cache_session.c
+++ b/bin/varnishd/cache/cache_session.c
@@ -537,11 +537,15 @@ SES_Delete(struct sess *sp, enum sess_close reason, double now)
if (isnan(now))
now = VTIM_real();
AZ(isnan(sp->t_open));
+ if (now < sp->t_open) {
+ if (now + cache_param->clock_step < sp->t_open)
+ WRONG("Clock step detected");
+ now = sp->t_open; /* Do not log negatives */
+ }
if (reason == SC_NULL)
reason = (enum sess_close)-sp->fd;
- assert(now >= sp->t_open);
assert(VTAILQ_EMPTY(&sp->privs->privs));
VSL(SLT_SessClose, sp->vxid, "%s %.3f",
sess_close_2str(reason, 0), now - sp->t_open);
More information about the varnish-commit
mailing list