[master] 78ac71a91 Add a parameter for the panic buffer size

Nils Goroll nils.goroll at uplex.de
Mon Jul 8 13:25:06 UTC 2024


commit 78ac71a91d5eb042ecd8e5abc0e6157265879bdd
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Jul 8 11:26:01 2024 +0200

    Add a parameter for the panic buffer size
    
    64k ought to be enough for everyone. /s

diff --git a/bin/varnishd/mgt/mgt_shmem.c b/bin/varnishd/mgt/mgt_shmem.c
index 858dfafdd..d67fca001 100644
--- a/bin/varnishd/mgt/mgt_shmem.c
+++ b/bin/varnishd/mgt/mgt_shmem.c
@@ -131,7 +131,7 @@ mgt_SHM_ChildNew(void)
 	AN(heritage.param);
 	*heritage.param = mgt_param;
 
-	heritage.panic_str_len = 64 * 1024;
+	heritage.panic_str_len = mgt_param.panic_buffer;
 	heritage.panic_str = VSMW_Allocf(mgt_vsmw, NULL, "Panic",
 	    heritage.panic_str_len, "");
 	AN(heritage.panic_str);
diff --git a/include/tbl/params.h b/include/tbl/params.h
index 938b00f4b..68da7d742 100644
--- a/include/tbl/params.h
+++ b/include/tbl/params.h
@@ -732,6 +732,22 @@ PARAM_SIMPLE(
 	/* flags */	EXPERIMENTAL
 )
 
+PARAM_SIMPLE(
+	/* name */	panic_buffer,
+	/* type */	bytes_u,
+	/* min */	"4k",
+	/* max */	"10m",
+	/* def */	"64k",
+	/* units */	"bytes",
+	/* descr */
+	"Size of the panic message buffer.\n"
+	"The panic buffer is allocated in the working directory as memory "
+	"shared between the management and worker process, so sufficient "
+	"working directory space should be accounted for if this value is "
+	"adjusted. Panic messages are truncated to the configured size.",
+	/* flags */	MUST_RESTART
+)
+
 PARAM_SIMPLE(
 	/* name */	pcre2_jit_compilation,
 	/* type */	boolean,


More information about the varnish-commit mailing list