[master] 8efe9c1 Call VFP_Error() in VFP_Push() if we run out of workspace.

Poul-Henning Kamp phk at FreeBSD.org
Wed Sep 20 08:45:06 UTC 2017


commit 8efe9c1f84ea697f39c6edafcd34543286c70d70
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Sep 20 08:44:09 2017 +0000

    Call VFP_Error() in VFP_Push() if we run out of workspace.

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 8839642..21661c8 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -566,9 +566,6 @@ vbf_stp_fetchbody(struct worker *wrk, struct busyobj *bo)
 #define vbf_vfp_push(bo, vfp, top)					\
 	do {								\
 		if (VFP_Push((bo)->vfc, (vfp), (top)) == NULL) {	\
-			assert (WS_Overflowed((bo)->vfc->http->ws));	\
-			(void)VFP_Error((bo)->vfc,			\
-			    "workspace_backend overflow");		\
 			(bo)->htc->doclose = SC_OVERLOAD;		\
 			VDI_Finish((bo)->wrk, bo);			\
 			return (F_STP_ERROR);				\
diff --git a/bin/varnishd/cache/cache_fetch_proc.c b/bin/varnishd/cache/cache_fetch_proc.c
index 8a30f59..1bb7df3 100644
--- a/bin/varnishd/cache/cache_fetch_proc.c
+++ b/bin/varnishd/cache/cache_fetch_proc.c
@@ -203,8 +203,10 @@ VFP_Push(struct vfp_ctx *vc, const struct vfp *vfp, int top)
 	CHECK_OBJ_NOTNULL(vc->http, HTTP_MAGIC);
 
 	vfe = WS_Alloc(vc->http->ws, sizeof *vfe);
-	if (vfe == NULL)
+	if (vfe == NULL) {
+		(void)VFP_Error(vc, "Workspace overflow");
 		return (NULL);
+	}
 
 	INIT_OBJ(vfe, VFP_ENTRY_MAGIC);
 	vfe->vfp = vfp;
diff --git a/bin/varnishtest/tests/r01739.vtc b/bin/varnishtest/tests/r01739.vtc
index c839542..7b8d656 100644
--- a/bin/varnishtest/tests/r01739.vtc
+++ b/bin/varnishtest/tests/r01739.vtc
@@ -16,7 +16,7 @@ varnish v1 -vcl+backend {
 } -start
 
 logexpect l1 -v v1 -g raw {
-	expect * 1002 FetchError {^workspace_backend overflow}
+	expect * 1002 FetchError {^Workspace overflow}
 	expect * =    Error      {^out of workspace [(]Bo[)]}
 } -start
 


More information about the varnish-commit mailing list