Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
33d80aba
Commit
33d80aba
authored
Mar 11, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement "return(retry)" in vcl_backend_error{}
parent
2eabf10f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
1 deletion
+38
-1
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+14
-1
c00061.vtc
bin/varnishtest/tests/c00061.vtc
+24
-0
No files found.
bin/varnishd/cache/cache_fetch.c
View file @
33d80aba
...
...
@@ -666,7 +666,20 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo)
AZ
(
VSB_finish
(
bo
->
synth_body
));
xxxassert
(
wrk
->
handling
==
VCL_RET_DELIVER
);
if
(
wrk
->
handling
==
VCL_RET_RETRY
)
{
VSB_delete
(
bo
->
synth_body
);
bo
->
synth_body
=
NULL
;
if
(
bo
->
retries
++
<
cache_param
->
max_retries
)
{
return
(
F_STP_RETRY
);
}
bo
->
synth_body
=
NULL
;
HSH_Fail
(
bo
->
fetch_objcore
);
VBO_setstate
(
bo
,
BOS_FAILED
);
HSH_Complete
(
bo
->
fetch_objcore
);
return
(
F_STP_DONE
);
}
assert
(
wrk
->
handling
==
VCL_RET_DELIVER
);
if
(
vbf_beresp2obj
(
bo
))
{
VBO_setstate
(
bo
,
BOS_FAILED
);
...
...
bin/varnishtest/tests/c00061.vtc
0 → 100644
View file @
33d80aba
varnishtest "retry in vcl_backend_error"
varnish v1 -vcl {
backend b1 { .host = "${bad_ip}"; }
sub vcl_backend_error {
return (retry);
}
sub vcl_error {
set obj.status = 504;
}
} -start
varnish v1 -cliok "param.set debug +syncvsl"
varnish v1 -cliok "param.set connect_timeout 1"
varnish v1 -cliok "param.set max_retries 2"
client c1 {
txreq
rxresp
expect resp.status == 504
} -run
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment