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
2679bb6d
Commit
2679bb6d
authored
May 15, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow return(abandon) in vcl_backend_error{}
Submitted by: fgs
parent
6eb3f1eb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
6 deletions
+27
-6
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+4
-2
b00038.vtc
bin/varnishtest/tests/b00038.vtc
+22
-3
generate.py
lib/libvcc/generate.py
+1
-1
No files found.
bin/varnishd/cache/cache_fetch.c
View file @
2679bb6d
...
...
@@ -800,14 +800,16 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo)
AZ
(
VSB_finish
(
synth_body
));
if
(
wrk
->
handling
==
VCL_RET_RETRY
)
{
if
(
wrk
->
handling
==
VCL_RET_RETRY
||
wrk
->
handling
==
VCL_RET_ABANDON
)
{
VSB_delete
(
synth_body
);
bo
->
doclose
=
SC_RESP_CLOSE
;
if
(
bo
->
director_state
!=
DIR_S_NULL
)
VDI_Finish
(
bo
->
wrk
,
bo
);
if
(
bo
->
retries
++
<
cache_param
->
max_retries
)
if
(
wrk
->
handling
==
VCL_RET_RETRY
&&
bo
->
retries
++
<
cache_param
->
max_retries
)
return
(
F_STP_RETRY
);
return
(
F_STP_FAIL
);
...
...
bin/varnishtest/tests/b00038.vtc
View file @
2679bb6d
varnishtest "
vcl_backend_fetch abandon
"
varnishtest "
Test abandon from vcl_backend_xxx
"
server s1 {
rxreq
expect req.url == "/bar"
txresp
} -start
varnish v1 -vcl+backend {
varnish v1 -
arg "-pfirst_byte_timeout=0.1" -
vcl+backend {
sub vcl_backend_fetch {
if (bereq.url == "/foo") {
return (abandon);
}
}
sub vcl_backend_response {
if (bereq.url == "/bar") {
return (abandon);
}
}
sub vcl_backend_error {
return (abandon);
}
} -start
client c1 {
txreq
txreq -url /foo
rxresp
expect resp.status == 503
txreq -url /bar
rxresp
expect resp.status == 503
txreq -url /baz
rxresp
expect resp.status == 503
} -run
lib/libvcc/generate.py
View file @
2679bb6d
...
...
@@ -132,7 +132,7 @@ returns =(
),
(
'backend_error'
,
"B"
,
(
'deliver'
,
'retry'
)
(
'deliver'
,
'retry'
,
'abandon'
)
),
###############################################################
...
...
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