[master] cd0484548 Panic: dump basic pool info
Nils Goroll
nils.goroll at uplex.de
Wed Dec 23 09:46:08 UTC 2020
commit cd048454894466e979bc96c022bff9be9d968786
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Wed Dec 23 10:35:38 2020 +0100
Panic: dump basic pool info
This is to chase a new case of the watchdog off the leash
diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index e20e07f80..91268deaa 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -788,6 +788,7 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
if (bo != NULL)
VSL_Flush(bo->vsl, 0);
VMOD_Panic(pan_vsb);
+ pan_pool(pan_vsb);
} else {
VSB_cat(pan_vsb, "Feature short panic suppressed details.\n");
}
diff --git a/bin/varnishd/cache/cache_pool.c b/bin/varnishd/cache/cache_pool.c
index bfdddccb0..7cc42b0cd 100644
--- a/bin/varnishd/cache/cache_pool.c
+++ b/bin/varnishd/cache/cache_pool.c
@@ -239,6 +239,27 @@ pool_poolherder(void *priv)
NEEDLESS(return (NULL));
}
+/*--------------------------------------------------------------------*/
+void
+pan_pool(struct vsb *vsb)
+{
+ struct pool *pp;
+
+ VSB_printf(vsb, "pools = {\n");
+ VSB_indent(vsb, 2);
+ VTAILQ_FOREACH(pp, &pools, list) {
+ if (PAN_dump_struct(vsb, pp, POOL_MAGIC, "pool"))
+ continue;
+ VSB_printf(vsb, "nidle = %u,\n", pp->nidle);
+ VSB_printf(vsb, "nthr = %u,\n", pp->nthr);
+ VSB_printf(vsb, "lqueue = %u\n", pp->lqueue);
+ VSB_indent(vsb, -2);
+ VSB_printf(vsb, "},\n");
+ }
+ VSB_indent(vsb, -2);
+ VSB_printf(vsb, "},\n");
+}
+
/*--------------------------------------------------------------------*/
void
diff --git a/bin/varnishd/cache/cache_varnishd.h b/bin/varnishd/cache/cache_varnishd.h
index 84316cee8..d74f6ed5b 100644
--- a/bin/varnishd/cache/cache_varnishd.h
+++ b/bin/varnishd/cache/cache_varnishd.h
@@ -361,6 +361,7 @@ void Pool_Sumstat(const struct worker *w);
int Pool_TrySumstat(const struct worker *wrk);
void Pool_PurgeStat(unsigned nobj);
int Pool_Task_Any(struct pool_task *task, enum task_prio prio);
+void pan_pool(struct vsb *);
/* cache_req.c */
struct req *Req_New(const struct worker *, struct sess *);
More information about the varnish-commit
mailing list