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
41a719c9
Commit
41a719c9
authored
Feb 20, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Urg, forgot the outher loop of the ban-lurker:
Fix previous change to not madly leak memory.
parent
81400111
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
cache_ban.c
bin/varnishd/cache/cache_ban.c
+14
-14
No files found.
bin/varnishd/cache/cache_ban.c
View file @
41a719c9
...
...
@@ -796,20 +796,17 @@ ban_CheckLast(void)
*/
static
int
ban_lurker_work
(
struct
worker
*
wrk
,
unsigned
pass
)
ban_lurker_work
(
struct
worker
*
wrk
,
struct
vsl_log
*
vsl
,
unsigned
pass
)
{
struct
ban
*
b
,
*
b0
,
*
b2
;
struct
objhead
*
oh
;
struct
objcore
*
oc
,
*
oc2
;
struct
object
*
o
;
struct
vsl_log
vsl
;
int
i
;
AN
(
pass
&
BAN_F_LURK
);
AZ
(
pass
&
~
BAN_F_LURK
);
VSL_Setup
(
&
vsl
,
NULL
,
0
);
/* First route the last ban(s) */
do
{
Lck_Lock
(
&
ban_mtx
);
...
...
@@ -839,13 +836,13 @@ ban_lurker_work(struct worker *wrk, unsigned pass)
b
->
flags
|=
pass
;
}
if
(
cache_param
->
diag_bitmap
&
0x80000
)
VSLb
(
&
vsl
,
SLT_Debug
,
"lurker: %d actionable bans"
,
i
);
VSLb
(
vsl
,
SLT_Debug
,
"lurker: %d actionable bans"
,
i
);
if
(
i
==
0
)
return
(
0
);
VTAILQ_FOREACH_REVERSE
(
b
,
&
ban_head
,
banhead_s
,
list
)
{
if
(
cache_param
->
diag_bitmap
&
0x80000
)
VSLb
(
&
vsl
,
SLT_Debug
,
"lurker doing %f %d"
,
VSLb
(
vsl
,
SLT_Debug
,
"lurker doing %f %d"
,
ban_time
(
b
->
spec
),
b
->
refcount
);
while
(
1
)
{
Lck_Lock
(
&
ban_mtx
);
...
...
@@ -854,7 +851,7 @@ ban_lurker_work(struct worker *wrk, unsigned pass)
break
;
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
if
(
cache_param
->
diag_bitmap
&
0x80000
)
VSLb
(
&
vsl
,
SLT_Debug
,
"test: %p %u %u"
,
VSLb
(
vsl
,
SLT_Debug
,
"test: %p %u %u"
,
oc
,
oc
->
flags
&
OC_F_LURK
,
pass
);
if
((
oc
->
flags
&
OC_F_LURK
)
==
pass
)
break
;
...
...
@@ -862,7 +859,7 @@ ban_lurker_work(struct worker *wrk, unsigned pass)
CHECK_OBJ_NOTNULL
(
oh
,
OBJHEAD_MAGIC
);
if
(
Lck_Trylock
(
&
oh
->
mtx
))
{
Lck_Unlock
(
&
ban_mtx
);
VSL_Flush
(
&
vsl
,
0
);
VSL_Flush
(
vsl
,
0
);
VTIM_sleep
(
cache_param
->
ban_lurker_sleep
);
continue
;
}
...
...
@@ -892,9 +889,9 @@ ban_lurker_work(struct worker *wrk, unsigned pass)
* Get the object and check it against all relevant bans
*/
o
=
oc_getobj
(
&
wrk
->
stats
,
oc
);
i
=
ban_check_object
(
o
,
&
vsl
,
NULL
);
i
=
ban_check_object
(
o
,
vsl
,
NULL
);
if
(
cache_param
->
diag_bitmap
&
0x80000
)
VSLb
(
&
vsl
,
SLT_Debug
,
"lurker got: %p %d"
,
VSLb
(
vsl
,
SLT_Debug
,
"lurker got: %p %d"
,
oc
,
i
);
if
(
i
==
-
1
)
{
/* Not banned, not moved */
...
...
@@ -906,7 +903,7 @@ ban_lurker_work(struct worker *wrk, unsigned pass)
}
Lck_Unlock
(
&
oh
->
mtx
);
if
(
cache_param
->
diag_bitmap
&
0x80000
)
VSLb
(
&
vsl
,
SLT_Debug
,
"lurker done: %p %u %u"
,
VSLb
(
vsl
,
SLT_Debug
,
"lurker done: %p %u %u"
,
oc
,
oc
->
flags
&
OC_F_LURK
,
pass
);
(
void
)
HSH_Deref
(
&
wrk
->
stats
,
NULL
,
&
o
);
VTIM_sleep
(
cache_param
->
ban_lurker_sleep
);
...
...
@@ -918,7 +915,7 @@ ban_lurker_work(struct worker *wrk, unsigned pass)
VSC_C_main
->
bans_gone
++
;
}
if
(
cache_param
->
diag_bitmap
&
0x80000
)
VSLb
(
&
vsl
,
SLT_Debug
,
"lurker BAN %f now gone"
,
VSLb
(
vsl
,
SLT_Debug
,
"lurker BAN %f now gone"
,
ban_time
(
b
->
spec
));
}
Lck_Unlock
(
&
ban_mtx
);
...
...
@@ -934,8 +931,11 @@ ban_lurker(struct worker *wrk, void *priv)
{
struct
ban
*
bf
;
unsigned
pass
=
(
1
<<
LURK_SHIFT
);
struct
vsl_log
vsl
;
int
i
=
0
;
VSL_Setup
(
&
vsl
,
NULL
,
0
);
(
void
)
priv
;
while
(
1
)
{
...
...
@@ -953,8 +953,8 @@ ban_lurker(struct worker *wrk, void *priv)
VTIM_sleep
(
1
.
0
);
}
i
=
ban_lurker_work
(
wrk
,
pass
);
VSL_Flush
(
wrk
->
vsl
,
0
);
i
=
ban_lurker_work
(
wrk
,
&
vsl
,
pass
);
VSL_Flush
(
&
vsl
,
0
);
WRK_SumStat
(
wrk
);
if
(
i
)
{
pass
+=
(
1
<<
LURK_SHIFT
);
...
...
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