Commit 77359df1 authored by Tollef Fog Heen's avatar Tollef Fog Heen

Always update stats in wrk_decimate_flock

Make sure to update the stats even if we don't kill off any excess
threads.

Fixes #308


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3188 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 28b68b4b
......@@ -431,21 +431,19 @@ wrk_addpools(const unsigned pools)
static void
wrk_decimate_flock(struct wq *qp, double t_idle, struct varnish_stats *vs)
{
struct worker *w;
if (qp->nthr <= params->wthread_min)
return;
struct worker *w = NULL;
LOCK(&qp->mtx);
w = VTAILQ_LAST(&qp->idle, workerhead);
if (w != NULL && (w->lastused < t_idle || qp->nthr > nthr_max))
VTAILQ_REMOVE(&qp->idle, w, list);
else
w = NULL;
vs->n_wrk += qp->nthr;
vs->n_wrk_queue += qp->nqueue;
vs->n_wrk_drop += qp->ndrop;
vs->n_wrk_overflow += qp->noverflow;
if (qp->nthr > params->wthread_min) {
w = VTAILQ_LAST(&qp->idle, workerhead);
if (w != NULL && (w->lastused < t_idle || qp->nthr > nthr_max))
VTAILQ_REMOVE(&qp->idle, w, list);
}
UNLOCK(&qp->mtx);
/* And give it a kiss on the cheek... */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment