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
a43326dd
Commit
a43326dd
authored
Apr 01, 2014
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rearm at zero TTL on failed objects
Fixes: #1468
parent
acd718f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
0 deletions
+58
-0
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+5
-0
r01468.vtc
bin/varnishtest/tests/r01468.vtc
+53
-0
No files found.
bin/varnishd/cache/cache_fetch.c
View file @
a43326dd
...
...
@@ -707,6 +707,11 @@ vbf_stp_fail(struct worker *wrk, struct busyobj *bo)
assert
(
bo
->
state
<
BOS_FINISHED
);
HSH_Fail
(
bo
->
fetch_objcore
);
if
(
bo
->
fetch_objcore
->
exp_flags
&
OC_EF_EXP
)
{
/* Already unbusied - expire it */
AN
(
bo
->
fetch_obj
);
EXP_Rearm
(
bo
->
fetch_obj
,
bo
->
fetch_obj
->
exp
.
t_origin
,
0
,
0
,
0
);
}
wrk
->
stats
.
fetch_failed
++
;
VBO_setstate
(
bo
,
BOS_FAILED
);
return
(
F_STP_DONE
);
...
...
bin/varnishtest/tests/r01468.vtc
0 → 100644
View file @
a43326dd
varnishtest "#1468 - freeing failed obj"
server s1 {
rxreq
expect req.url == "/1"
txresp -nolen -hdr "Transfer-Encoding: chunked"
chunked {<HTML>}
sema r1 sync 2
close
accept
rxreq
expect req.url == "/2"
txresp -nolen -hdr "Transfer-Encoding: chunked"
chunked {<HTML>}
sema r1 sync 2
} -start
varnish v1 -vcl+backend {
sub vcl_recv {
if (req.url == "/2") {
return (pass);
}
}
sub vcl_backend_response {
set beresp.ttl = 5m;
}
} -start
# Test the regular cached content case
client c1 {
txreq -url "/1"
rxresphdrs
expect resp.status == 200
rxchunk
sema r1 sync 2
expect_close
} -run
# Test the pass from vcl_recv case
client c1 {
txreq -url "/2"
rxresphdrs
expect resp.status == 200
rxchunk
sema r1 sync 2
expect_close
} -run
# Delay to allow expiry thread to do it's job
delay 1
varnish v1 -expect n_object == 0
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