[master] e1853a3d1 do not count deliberately ending the backend connection as fetch failure

Nils Goroll nils.goroll at uplex.de
Wed Nov 6 14:47:07 UTC 2019


commit e1853a3d1caf420bb3b9a151d0ebd01dbb4b6bdf
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Aug 8 16:05:29 2019 +0200

    do not count deliberately ending the backend connection as fetch failure
    
    now that we pass the bo's handling to the director method, in the case
    of return(error) from v_b_f, we do no not want the deliberate
    VDI_Finish() to change the handling from vcl.

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 38a25d6dd..8e59d5321 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -286,6 +286,7 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo)
 {
 	int i;
 	vtim_real now;
+	unsigned handling;
 
 	CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
 	CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
@@ -416,9 +417,15 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo)
 
 	if (wrk->handling == VCL_RET_ABANDON || wrk->handling == VCL_RET_FAIL ||
 	    wrk->handling == VCL_RET_ERROR) {
+		/* do not count deliberately ending the backend connection as
+		 * fetch failure
+		 */
+		handling = wrk->handling;
 		if (bo->htc)
 			bo->htc->doclose = SC_RESP_CLOSE;
 		vbf_cleanup(bo);
+		wrk->handling = handling;
+
 		if (wrk->handling == VCL_RET_ERROR)
 			return (F_STP_ERROR);
 		else


More information about the varnish-commit mailing list