Permalink
Browse files

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
  • Loading branch information...
nigoroll committed Oct 9, 2018
1 parent 6788ed4 commit 4dcb8fb925dff2597311d069818644d57451c7d6
Showing with 6 additions and 5 deletions.
  1. +6 −5 bin/varnishd/cache/cache_wrk.c
@@ -510,14 +510,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;

0 comments on commit 4dcb8fb

Please sign in to comment.