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