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
4067f504
Commit
4067f504
authored
Jan 29, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't put objcores on the ban list until they go non-BUSY.
Fixes #1419
parent
08e2b3a8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
6 deletions
+46
-6
cache_ban.c
bin/varnishd/cache/cache_ban.c
+1
-0
cache_hash.c
bin/varnishd/cache/cache_hash.c
+2
-4
stevedore.c
bin/varnishd/storage/stevedore.c
+0
-2
r01419.vtc
bin/varnishtest/tests/r01419.vtc
+43
-0
No files found.
bin/varnishd/cache/cache_ban.c
View file @
4067f504
...
@@ -1030,6 +1030,7 @@ ban_lurker_getfirst(struct vsl_log *vsl, struct ban *bt)
...
@@ -1030,6 +1030,7 @@ ban_lurker_getfirst(struct vsl_log *vsl, struct ban *bt)
* We got the lock, and the oc is not being
* We got the lock, and the oc is not being
* dismantled under our feet, run with it...
* dismantled under our feet, run with it...
*/
*/
AZ
(
oc
->
flags
&
OC_F_BUSY
);
oc
->
refcnt
+=
1
;
oc
->
refcnt
+=
1
;
VTAILQ_REMOVE
(
&
bt
->
objcore
,
oc
,
ban_list
);
VTAILQ_REMOVE
(
&
bt
->
objcore
,
oc
,
ban_list
);
VTAILQ_INSERT_TAIL
(
&
bt
->
objcore
,
oc
,
ban_list
);
VTAILQ_INSERT_TAIL
(
&
bt
->
objcore
,
oc
,
ban_list
);
...
...
bin/varnishd/cache/cache_hash.c
View file @
4067f504
...
@@ -667,10 +667,6 @@ HSH_Unbusy(struct dstat *ds, struct objcore *oc)
...
@@ -667,10 +667,6 @@ HSH_Unbusy(struct dstat *ds, struct objcore *oc)
CHECK_OBJ
(
oh
,
OBJHEAD_MAGIC
);
CHECK_OBJ
(
oh
,
OBJHEAD_MAGIC
);
AN
(
oc
->
flags
&
OC_F_BUSY
);
AN
(
oc
->
flags
&
OC_F_BUSY
);
if
(
oc
->
flags
&
OC_F_PRIVATE
)
AZ
(
oc
->
ban
);
else
AN
(
oc
->
ban
);
assert
(
oh
->
refcnt
>
0
);
assert
(
oh
->
refcnt
>
0
);
/* XXX: pretouch neighbors on oh->objcs to prevent page-on under mtx */
/* XXX: pretouch neighbors on oh->objcs to prevent page-on under mtx */
...
@@ -683,6 +679,8 @@ HSH_Unbusy(struct dstat *ds, struct objcore *oc)
...
@@ -683,6 +679,8 @@ HSH_Unbusy(struct dstat *ds, struct objcore *oc)
if
(
oh
->
waitinglist
!=
NULL
)
if
(
oh
->
waitinglist
!=
NULL
)
hsh_rush
(
ds
,
oh
);
hsh_rush
(
ds
,
oh
);
Lck_Unlock
(
&
oh
->
mtx
);
Lck_Unlock
(
&
oh
->
mtx
);
if
(
!
(
oc
->
flags
&
OC_F_PRIVATE
))
BAN_NewObjCore
(
oc
);
}
}
/*---------------------------------------------------------------------
/*---------------------------------------------------------------------
...
...
bin/varnishd/storage/stevedore.c
View file @
4067f504
...
@@ -291,8 +291,6 @@ STV_MkObject(struct stevedore *stv, struct busyobj *bo,
...
@@ -291,8 +291,6 @@ STV_MkObject(struct stevedore *stv, struct busyobj *bo,
bo
->
stats
->
n_object
++
;
bo
->
stats
->
n_object
++
;
o
->
objcore
=
bo
->
fetch_objcore
;
o
->
objcore
=
bo
->
fetch_objcore
;
if
(
!
(
o
->
objcore
->
flags
&
OC_F_PRIVATE
))
BAN_NewObjCore
(
o
->
objcore
);
o
->
objcore
->
methods
=
&
default_oc_methods
;
o
->
objcore
->
methods
=
&
default_oc_methods
;
o
->
objcore
->
priv
=
o
;
o
->
objcore
->
priv
=
o
;
...
...
bin/varnishtest/tests/r01419.vtc
0 → 100644
View file @
4067f504
varnishtest "Make sure banlurker skips busy objects"
server s1 {
rxreq
send "HTTP/1.0 200 Ok\r\n"
sema r1 sync 2
send "Foobar: blaf\r\n"
send "Content-Length: 10\r\n"
send "\r\n\r\n"
send "abcde"
sema r2 sync 2
send "abcdefghij"
} -start
varnish v1 -vcl+backend {
sub vcl_backend_response {
set beresp.do_stream = false;
}
} -start
varnish v1 -cliok {param.set debug +lurker}
varnish v1 -cliok {param.set ban_lurker_age 1}
varnish v1 -cliok {ban.list}
client c1 {
txreq
rxresp
expect resp.status == 200
expect resp.http.foobar == blaf
} -start
sema r1 sync 2
varnish v1 -cliok {ban.list}
varnish v1 -cliok {ban obj.http.goo == bar}
varnish v1 -cliok {ban.list}
delay 2
varnish v1 -cliok {ban.list}
sema r2 sync 2
client c1 -wait
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