Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
3f56d4eb
Commit
3f56d4eb
authored
May 21, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ttl when backend fetches are salvaged into transient storage.
Submitted by: Martin Fixes #1140
parent
f289def3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
2 deletions
+41
-2
cache_center.c
bin/varnishd/cache/cache_center.c
+2
-2
r01140.vtc
bin/varnishtest/tests/r01140.vtc
+39
-0
No files found.
bin/varnishd/cache/cache_center.c
View file @
3f56d4eb
...
@@ -812,12 +812,12 @@ cnt_fetchbody(struct sess *sp, struct worker *wrk, struct req *req)
...
@@ -812,12 +812,12 @@ cnt_fetchbody(struct sess *sp, struct worker *wrk, struct req *req)
* Try to salvage the transaction by allocating a
* Try to salvage the transaction by allocating a
* shortlived object on Transient storage.
* shortlived object on Transient storage.
*/
*/
req
->
obj
=
STV_NewObject
(
bo
,
&
req
->
objcore
,
TRANSIENT_STORAGE
,
l
,
nhttp
);
if
(
bo
->
exp
.
ttl
>
cache_param
->
shortlived
)
if
(
bo
->
exp
.
ttl
>
cache_param
->
shortlived
)
bo
->
exp
.
ttl
=
cache_param
->
shortlived
;
bo
->
exp
.
ttl
=
cache_param
->
shortlived
;
bo
->
exp
.
grace
=
0
.
0
;
bo
->
exp
.
grace
=
0
.
0
;
bo
->
exp
.
keep
=
0
.
0
;
bo
->
exp
.
keep
=
0
.
0
;
req
->
obj
=
STV_NewObject
(
bo
,
&
req
->
objcore
,
TRANSIENT_STORAGE
,
l
,
nhttp
);
}
}
bo
->
stats
=
NULL
;
bo
->
stats
=
NULL
;
if
(
req
->
obj
==
NULL
)
{
if
(
req
->
obj
==
NULL
)
{
...
...
bin/varnishtest/tests/r01140.vtc
0 → 100644
View file @
3f56d4eb
varnishtest "Transient-salvaged objects ttl should be shortened - #1140"
server s1 {
# This response should almost completely fill the storage
rxreq
expect req.url == /url1
txresp -bodylen 1048050
# The next one should not fit in the storage, ending up in transient
# with zero ttl (=shortlived)
rxreq
expect req.url == /url2
txresp -bodylen 1024
# And therefore this one should be fetched next
rxreq
expect req.url == /url2
txresp -bodylen 1025
} -start
varnish v1 -arg "-p expiry_sleep=0.01 -p nuke_limit=0 -p shortlived=0" \
-storage "-smalloc,1m" -vcl+backend { } -start
client c1 {
txreq -url /url1
rxresp
expect resp.status == 200
expect resp.bodylen == 1048050
txreq -url /url2
rxresp
expect resp.status == 200
expect resp.bodylen == 1024
txreq -url /url2
rxresp
expect resp.status == 200
expect resp.bodylen == 1025
} -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