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
d3b6409e
Unverified
Commit
d3b6409e
authored
Apr 03, 2020
by
Emanuele Rocca
Committed by
Nils Goroll
Apr 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbf_stp_condfetch: handle storage error instead of crashing
Fixes: #3273
parent
3e5d5f29
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
1 deletion
+72
-1
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+6
-1
v00064.vtc
bin/varnishtest/tests/v00064.vtc
+66
-0
No files found.
bin/varnishd/cache/cache_fetch.c
View file @
d3b6409e
...
@@ -733,7 +733,12 @@ vbf_stp_condfetch(struct worker *wrk, struct busyobj *bo)
...
@@ -733,7 +733,12 @@ vbf_stp_condfetch(struct worker *wrk, struct busyobj *bo)
AZ
(
stale_boc
);
AZ
(
stale_boc
);
AZ
(
bo
->
stale_oc
->
flags
&
OC_F_FAILED
);
AZ
(
bo
->
stale_oc
->
flags
&
OC_F_FAILED
);
AZ
(
vbf_beresp2obj
(
bo
));
if
(
vbf_beresp2obj
(
bo
))
{
(
void
)
VFP_Error
(
bo
->
vfc
,
"Could not get storage in vbf_stp_condfetch"
);
vbf_cleanup
(
bo
);
wrk
->
stats
->
fetch_failed
++
;
return
(
F_STP_FAIL
);
}
if
(
ObjHasAttr
(
bo
->
wrk
,
bo
->
stale_oc
,
OA_ESIDATA
))
if
(
ObjHasAttr
(
bo
->
wrk
,
bo
->
stale_oc
,
OA_ESIDATA
))
AZ
(
ObjCopyAttr
(
bo
->
wrk
,
bo
->
fetch_objcore
,
bo
->
stale_oc
,
AZ
(
ObjCopyAttr
(
bo
->
wrk
,
bo
->
fetch_objcore
,
bo
->
stale_oc
,
...
...
bin/varnishtest/tests/v00064.vtc
0 → 100644
View file @
d3b6409e
varnishtest "vbf_stp_condfetch could not get storage #3273"
server s1 {
rxreq
expect req.url == "/transient"
txresp -bodylen 1048400
rxreq
expect req.url == "/malloc"
txresp -hdr "Cache-Control: max-age=2" -hdr "Last-Modified: Fri, 03 Apr 2020 13:00:01 GMT" -bodylen 1048300
rxreq
expect req.http.If-Modified-Since == "Fri, 03 Apr 2020 13:00:01 GMT"
expect req.url == "/malloc"
txresp -status 304
} -start
varnish v1 \
-arg "-s Transient=default,1m" \
-arg "-s malloc,1m" \
-arg "-p nuke_limit=0" \
-syntax 4.0 \
-vcl+backend {
sub vcl_backend_response {
if (bereq.url == "/transient") {
set beresp.storage = storage.Transient;
# Unset Date header to not change the object sizes
unset beresp.http.Date;
}
}
} -start
varnish v1 -cliok "param.set debug +syncvsl"
delay .1
client c1 {
# Fill transient
txreq -url "/transient"
rxresp
expect resp.status == 200
} -run
delay .1
varnish v1 -expect SM?.Transient.g_bytes > 1048000
varnish v1 -expect SM?.Transient.g_space == 8
client c1 {
# Fill malloc
txreq -url "/malloc" -hdr "If-Modified-Since: Fri, 03 Apr 2020 12:00:01 GMT"
rxresp
expect resp.status == 200
delay 3
} -run
varnish v1 -expect SM?.s0.g_bytes > 1048000
varnish v1 -expect SM?.s0.g_space == 4
client c1 {
# Check that Varnish is still alive
txreq -url "/malloc" -hdr "If-Modified-Since: Fri, 03 Apr 2020 12:00:01 GMT"
rxresp
expect resp.status == 200
} -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