[6.1] 2e336c041 keep the dog in the kennel unless there's a queue

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


commit 2e336c04101fc4ed4f000f9c3395f4e6fdce0622
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Oct 9 12:38:25 2018 +0200

    keep the dog in the kennel unless there's a queue
    
    As long as we are not queuing any threads, there is no queue to
    move. We record the queue marker the first time we notice queuing and
    only then see if it doesn't move.
    
    Fixes #2794

diff --git a/bin/varnishd/cache/cache_wrk.c b/bin/varnishd/cache/cache_wrk.c
index ad1fe08f6..011010499 100644
--- a/bin/varnishd/cache/cache_wrk.c
+++ b/bin/varnishd/cache/cache_wrk.c
@@ -511,14 +511,15 @@ pool_herder(void *priv)
 		 * Instead we implement a watchdog and kill the worker if
 		 * nothing has been dequeued for that long.
 		 */
-		if (dq != pp->ndequeued) {
+		if (pp->lqueue == 0) {
+			dq = pp->ndequeued + 1;
+		} else if (dq != pp->ndequeued) {
 			dq = pp->ndequeued;
 			dqt = VTIM_real();
-		} else if (pp->lqueue &&
-		    VTIM_real() - dqt > cache_param->wthread_watchdog) {
+		} else if (VTIM_real() - dqt > cache_param->wthread_watchdog) {
 			VSL(SLT_Error, 0,
-			   "Pool Herder: Queue does not move ql=%u dt=%f",
-			   pp->lqueue, VTIM_real() - dqt);
+			    "Pool Herder: Queue does not move ql=%u dt=%f",
+			    pp->lqueue, VTIM_real() - dqt);
 			WRONG("Worker Pool Queue does not move");
 		}
 		wthread_min = cache_param->wthread_min;


More information about the varnish-commit mailing list