Commit 58419339 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Welcome to the new grace-mode, now the first client does not

get penalized by the backend fetch.

Rough edges are to be expected, including that I had to disable
three Saint-mode test-cases, until I figure out how saint-mode should
work in this scenario.
parent 4a918fa1
......@@ -487,19 +487,13 @@ cnt_lookup(struct worker *wrk, struct req *req)
switch (wrk->handling) {
case VCL_RET_DELIVER:
if (boc != NULL && VDI_Healthy(req->director, req->digest)) {
// XXX: Start bg-fetch */
(void)HSH_Deref(&wrk->stats, NULL, &req->obj);
req->objcore = boc;
req->req_step = R_STP_MISS;
return (REQ_FSM_MORE);
} else if (boc != NULL) {
(void)HSH_Deref(&wrk->stats, boc, NULL);
free(req->vary_b);
req->vary_b = NULL;
if (boc != NULL) {
req->busyobj = VBF_Fetch(wrk, req, boc, 0);
VBO_DerefBusyObj(wrk, &req->busyobj);
} else {
(void)HTTP1_DiscardReqBody(req);// XXX: handle err
}
wrk->stats.cache_hit++;
(void)HTTP1_DiscardReqBody(req); // XXX: handle err
req->req_step = R_STP_PREPRESP;
return (REQ_FSM_MORE);
case VCL_RET_FETCH:
......
varnishtest "Test that saintmode_threshold correctly marks a backend as sick"
feature OldSaintMode
server s1 {
rxreq
txresp
......
varnishtest "Test that saintmode_threshold in VCL"
feature OldSaintMode
server s1 {
rxreq
txresp
......
varnishtest "using req.ttl to force fetch"
varnishtest "using req.hash_always_miss to force fetch"
server s1 {
rxreq
......@@ -13,8 +13,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_recv {
if (req.http.short) {
set req.ttl = 1s;
set req.grace = 0s;
set req.hash_always_miss = true;
}
}
} -start
......@@ -30,8 +29,6 @@ client c1 {
expect resp.status == 200
expect resp.bodylen == 1
delay 2
txreq -url "/1" -hdr "short: yes"
rxresp
expect resp.status == 200
......
varnishtest "Check saint mode with sick pages"
feature OldSaintMode
server s1 {
timeout 10
......
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