Page MenuHomePhabricator
Paste P4406

0005-gethdr_extrachance.patch
ActivePublic

Authored by ema on Nov 10 2016, 5:11 PM.
diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c
index 039d3b2..4324894 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -177,7 +177,7 @@ static int __match_proto__(vdi_gethdrs_f)
vbe_dir_gethdrs(const struct director *d, struct worker *wrk,
struct busyobj *bo)
{
- int i, extrachance = 1;
+ int i, extrachance = cache_param->gethdr_extrachance;
struct backend *bp;
struct vbc *vbc;
@@ -232,7 +232,7 @@ vbe_dir_gethdrs(const struct director *d, struct worker *wrk,
bo->req->req_body_status != REQ_BODY_CACHED)
break;
VSC_C_main->backend_retry++;
- } while (extrachance);
+ } while (extrachance-- > 0);
return (-1);
}
diff --git a/include/tbl/params.h b/include/tbl/params.h
index 5c3f46b..ec0a8cf 100644
--- a/include/tbl/params.h
+++ b/include/tbl/params.h
@@ -458,6 +458,20 @@ PARAM(
)
PARAM(
+ /* name */ gethdr_extrachance,
+ /* typ */ uint,
+ /* min */ "0",
+ /* max */ "5",
+ /* default */ "1",
+ /* units */ NULL,
+ /* flags */ EXPERIMENTAL,
+ /* s-text */
+ "Number of extra chances in vbe_dir_gethdrs.",
+ /* l-text */ "",
+ /* func */ NULL
+)
+
+PARAM(
/* name */ gzip_buffer,
/* typ */ bytes_u,
/* min */ "2k",

Event Timeline

ema created this paste.Nov 10 2016, 5:11 PM