[6.1] 3fdf117e6 use monotonic time for the watchdog

hermunn hermunn at varnish-software.com
Wed Oct 24 09:29:23 UTC 2018


commit 3fdf117e64e673e0031acf82b86dcb352c460620
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Oct 9 12:56:41 2018 +0200

    use monotonic time for the watchdog

diff --git a/bin/varnishd/cache/cache_wrk.c b/bin/varnishd/cache/cache_wrk.c
index 011010499..c133afe6f 100644
--- a/bin/varnishd/cache/cache_wrk.c
+++ b/bin/varnishd/cache/cache_wrk.c
@@ -490,7 +490,7 @@ pool_herder(void *priv)
 	double delay;
 	int wthread_min;
 	uintmax_t dq = (1ULL << 31);
-	double dqt = 0;
+	vtim_mono dqt = 0;
 
 	CAST_OBJ_NOTNULL(pp, priv, POOL_MAGIC);
 
@@ -515,11 +515,11 @@ pool_herder(void *priv)
 			dq = pp->ndequeued + 1;
 		} else if (dq != pp->ndequeued) {
 			dq = pp->ndequeued;
-			dqt = VTIM_real();
-		} else if (VTIM_real() - dqt > cache_param->wthread_watchdog) {
+			dqt = VTIM_mono();
+		} else if (VTIM_mono() - dqt > cache_param->wthread_watchdog) {
 			VSL(SLT_Error, 0,
 			    "Pool Herder: Queue does not move ql=%u dt=%f",
-			    pp->lqueue, VTIM_real() - dqt);
+			    pp->lqueue, VTIM_mono() - dqt);
 			WRONG("Worker Pool Queue does not move");
 		}
 		wthread_min = cache_param->wthread_min;


More information about the varnish-commit mailing list