[6.0] 17fdd6aa5 Add ws_session_overflow counter

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Wed Oct 31 13:08:31 UTC 2018


commit 17fdd6aa51abba888ed67e3ee6a2e0e06f9434b4
Author: Dag Haavi Finstad <daghf at varnish-software.com>
Date:   Thu Oct 11 14:52:12 2018 +0200

    Add ws_session_overflow counter

diff --git a/bin/varnishd/VSC_main.vsc b/bin/varnishd/VSC_main.vsc
index bbc1eb08f..f6925f30b 100644
--- a/bin/varnishd/VSC_main.vsc
+++ b/bin/varnishd/VSC_main.vsc
@@ -615,6 +615,12 @@
 
 	Number of times we ran out of space in workspace_thread.
 
+.. varnish_vsc:: ws_session_overflow
+	:level: diag
+	:oneliner: workspace_session overflows
+
+	Number of times we ran out of space in workspace_session.
+
 .. varnish_vsc:: shm_records
 	:level:	diag
 	:oneliner:	SHM records
diff --git a/bin/varnishd/cache/cache_session.c b/bin/varnishd/cache/cache_session.c
index 20ada52e3..fede8e0ae 100644
--- a/bin/varnishd/cache/cache_session.c
+++ b/bin/varnishd/cache/cache_session.c
@@ -545,6 +545,8 @@ SES_Delete(struct sess *sp, enum sess_close reason, double now)
 	VSL(SLT_SessClose, sp->vxid, "%s %.3f",
 	    sess_close_2str(reason, 0), now - sp->t_open);
 	VSL(SLT_End, sp->vxid, "%s", "");
+	if (WS_Overflowed(sp->ws))
+		VSC_C_main->ws_session_overflow++;
 	SES_Rel(sp);
 }
 
diff --git a/bin/varnishtest/tests/o00005.vtc b/bin/varnishtest/tests/o00005.vtc
index 3ec7a2881..3ae1aacfe 100644
--- a/bin/varnishtest/tests/o00005.vtc
+++ b/bin/varnishtest/tests/o00005.vtc
@@ -201,3 +201,46 @@ client c1 {
 varnish v1 -vsl_catchup
 
 logexpect l1 -wait
+
+client c1 {
+	# PROXY2 sp->ws overflow
+	sendhex {
+		0d 0a 0d 0a 00 0d 0a 51 55 49 54 0a
+		21 11 01 23
+		d9 46 b5 21
+		5f 8e a8 22
+		ed 96
+		01 bb
+		03 00 04  c5 1b 5b 2b
+		01 00 02  68 32
+		02 00 c8  61 61 61 61 61 61 61 61 61 61 61
+			  61 61 61 61 61 61 61 61 61 61 61
+			  61 61 61 61 61 61 61 61 61 61 61
+			  61 61 61 61 61 61 61 61 61 61 61
+			  61 61 61 61 61 61 61 61 61 61 61
+			  61 61 61 61 61 61 61 61 61 61 61
+			  61 61 61 61 61 61 61 61 61 61 61
+			  61 61 61 61 61 61 61 61 61 61 61
+			  61 61 61 61 61 61 61 61 61 61 61
+			  61 61 61 61 61 61 61 61 61 61 61
+			  61 61 61 61 61 61 61 61 61 61 61
+			  61 61 61 61 61 61 61 61 61 61 61
+			  61 61 61 61 61 61 61 61 61 61 61
+			  61 61 61 61 61 61 61 61 61 61 61
+			  61 61 61 61 61 61 61 61 61 61 61
+			  61 61 61 61 61 61 61 61 61 61 61
+			  61 61 61 61 61 61 61 61 61 61 61
+			  61 61 61 61 61 61 61 61 61 61 61
+			  61 61
+		20 00 3d
+		01 00 00 00 00
+		21 00 07  54 4c 53 76 31 2e 33
+		25 00 05  45 43 32 35 36
+		24 00 0a  52 53 41 2d 53 48 41 32 35 36
+		23 00 16  41 45 41 44 2d 41 45 53 31 32 38
+			  2d 47 43 4d 2d 53 48 41 32 35 36
+	}
+	expect_close
+} -run
+
+varnish v1 -expect ws_session_overflow == 1


More information about the varnish-commit mailing list