Commit 9920174e authored by Federico G. Schwindt's avatar Federico G. Schwindt Committed by Pål Hermunn Johansen

Increment fetch_failed for all causes

IOW if we ended up in vcl_backend_error{} or failed after returning
delivery in vcl_backend_response{} (e.g. we did not receive enough bytes)
we will bump this counter.

Conflicts:
	bin/varnishd/cache/cache_fetch.c
	bin/varnishtest/tests/r01624.vtc
	include/tbl/vsc_f_main.h
parent efc000f5
......@@ -687,6 +687,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
// XXX: doclose = ?
return (F_STP_ERROR);
} else {
wrk->stats->fetch_failed++;
return (F_STP_FAIL);
}
}
......@@ -763,6 +764,7 @@ vbf_stp_condfetch(struct worker *wrk, struct busyobj *bo)
(void)VFP_Error(bo->vfc, "Template object failed");
if (bo->vfc->failed) {
VDI_Finish(bo->wrk, bo);
wrk->stats->fetch_failed++;
return (F_STP_FAIL);
}
......@@ -799,6 +801,8 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo)
AN(bo->fetch_objcore->flags & OC_F_BUSY);
assert(bo->director_state == DIR_S_NULL);
wrk->stats->fetch_failed++;
now = W_TIM_real(wrk);
VSLb_ts_busyobj(bo, "Error", now);
......@@ -899,7 +903,6 @@ vbf_stp_fail(struct worker *wrk, struct busyobj *bo)
EXP_Rearm(bo->fetch_objcore,
bo->fetch_objcore->exp.t_origin, 0, 0, 0);
}
wrk->stats->fetch_failed++;
VBO_setstate(bo, BOS_FAILED);
return (F_STP_DONE);
}
......
......@@ -46,4 +46,4 @@ client c1 {
varnish v1 -expect n_object == 1
varnish v1 -expect n_objectcore == 1
varnish v1 -expect fetch_failed == 1
......@@ -17,7 +17,6 @@ client c1 {
expect resp.status == 503
} -run
server s1 {
rxreq
delay 0.5
......@@ -29,3 +28,5 @@ client c1 {
rxresp
expect resp.status == 200
} -run
varnish v1 -expect fetch_failed == 1
......@@ -35,3 +35,5 @@ client c1 {
rxresp
expect resp.status == 503
} -run
varnish v1 -expect fetch_failed == 1
......@@ -22,3 +22,6 @@ client c1 {
rxresp
expect resp.status == 504
} -run
varnish v1 -expect backend_fail == 3
varnish v1 -expect fetch_failed == 3
......@@ -25,9 +25,10 @@ varnish v1 -vcl+backend {} -start
client c1 {
txreq
rxresphdrs
expect resp.status == 200
non-fatal
timeout 3
rxresp
rxrespbody
} -run
delay .2
......@@ -38,3 +39,5 @@ client c1 {
rxresp
expect resp.bodylen == 7
} -run
varnish v1 -expect fetch_failed == 1
......@@ -73,3 +73,5 @@ client c3 {
expect resp.status == 200
expect resp.body == "abcdef"
} -run
varnish v1 -expect fetch_failed == 2
......@@ -184,7 +184,7 @@ VSC_F(fetch_304, uint64_t, 1, 'c', 'i', info,
"beresp with no body because of 304 response."
)
VSC_F(fetch_failed, uint64_t, 1, 'c', 'i', info,
"Fetch failed (all causes), where we do get hold of the backend.",
"Fetch failed (all causes)",
"beresp fetch failed."
)
VSC_F(fetch_no_thread, uint64_t, 1, 'c', 'i', info,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment