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
53e74e4d
Commit
53e74e4d
authored
Nov 30, 2012
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Report BAN event persistence failures back to cache_ban.c
parent
8e646cfb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
12 deletions
+27
-12
cache.h
bin/varnishd/cache/cache.h
+1
-1
cache_ban.c
bin/varnishd/cache/cache_ban.c
+3
-3
stevedore.c
bin/varnishd/storage/stevedore.c
+11
-2
storage.h
bin/varnishd/storage/storage.h
+1
-1
storage_persistent.c
bin/varnishd/storage/storage_persistent.c
+11
-5
No files found.
bin/varnishd/cache/cache.h
View file @
53e74e4d
...
...
@@ -1060,7 +1060,7 @@ void STV_free(struct storage *st);
void
STV_open
(
void
);
void
STV_close
(
void
);
void
STV_Freestore
(
struct
object
*
o
);
void
STV_BanInfo
(
enum
baninfo
event
,
const
uint8_t
*
ban
,
unsigned
len
);
int
STV_BanInfo
(
enum
baninfo
event
,
const
uint8_t
*
ban
,
unsigned
len
);
/* storage_synth.c */
struct
vsb
*
SMS_Makesynth
(
struct
object
*
obj
);
...
...
bin/varnishd/cache/cache_ban.c
View file @
53e74e4d
...
...
@@ -484,7 +484,7 @@ BAN_Insert(struct ban *b)
* can have entered the cache (thus no objects in the mean
* time depending on ban_magic in the list) */
if
(
b
!=
ban_magic
)
STV_BanInfo
(
BI_NEW
,
b
->
spec
,
ln
);
/* Notify stevedores */
AZ
(
STV_BanInfo
(
BI_NEW
,
b
->
spec
,
ln
)
);
/* Notify stevedores */
Lck_Unlock
(
&
ban_mtx
);
if
(
be
==
NULL
)
...
...
@@ -690,7 +690,7 @@ BAN_Compile(void)
AZ
(
ban_shutdown
);
/* Do late reporting of ban_magic */
STV_BanInfo
(
BI_NEW
,
ban_magic
->
spec
,
ban_len
(
ban_magic
->
spec
));
AZ
(
STV_BanInfo
(
BI_NEW
,
ban_magic
->
spec
,
ban_len
(
ban_magic
->
spec
)
));
ban_start
=
VTAILQ_FIRST
(
&
ban_head
);
WRK_BgThread
(
&
ban_thread
,
"ban-lurker"
,
ban_lurker
,
NULL
);
...
...
@@ -883,7 +883,7 @@ ban_cleantail(void)
VSC_C_main
->
bans
--
;
VSC_C_main
->
bans_deleted
++
;
VTAILQ_REMOVE
(
&
ban_head
,
b
,
list
);
STV_BanInfo
(
BI_DROP
,
b
->
spec
,
ban_len
(
b
->
spec
));
AZ
(
STV_BanInfo
(
BI_DROP
,
b
->
spec
,
ban_len
(
b
->
spec
)
));
}
else
{
b
=
NULL
;
}
...
...
bin/varnishd/storage/stevedore.c
View file @
53e74e4d
...
...
@@ -453,14 +453,23 @@ STV_close(void)
stv
->
close
(
stv
);
}
void
/*-------------------------------------------------------------------
* Notify the stevedores of BAN related events. A non-zero return
* value indicates that the stevedore is unable to persist the
* event.
*/
int
STV_BanInfo
(
enum
baninfo
event
,
const
uint8_t
*
ban
,
unsigned
len
)
{
struct
stevedore
*
stv
;
int
r
=
0
;
VTAILQ_FOREACH
(
stv
,
&
stv_stevedores
,
list
)
if
(
stv
->
baninfo
!=
NULL
)
stv
->
baninfo
(
stv
,
event
,
ban
,
len
);
r
|=
stv
->
baninfo
(
stv
,
event
,
ban
,
len
);
return
(
r
);
}
/*--------------------------------------------------------------------
...
...
bin/varnishd/storage/storage.h
View file @
53e74e4d
...
...
@@ -48,7 +48,7 @@ typedef struct object *storage_allocobj_f(struct stevedore *, struct busyobj *,
struct
objcore
**
,
unsigned
ltot
,
const
struct
stv_objsecrets
*
);
typedef
void
storage_close_f
(
const
struct
stevedore
*
);
typedef
void
storage_signal_close_f
(
const
struct
stevedore
*
);
typedef
void
storage_baninfo_f
(
struct
stevedore
*
,
enum
baninfo
event
,
typedef
int
storage_baninfo_f
(
struct
stevedore
*
,
enum
baninfo
event
,
const
uint8_t
*
ban
,
unsigned
len
);
/* Prototypes for VCL variable responders */
...
...
bin/varnishd/storage/storage_persistent.c
View file @
53e74e4d
...
...
@@ -68,37 +68,43 @@ static VTAILQ_HEAD(,smp_sc) silos = VTAILQ_HEAD_INITIALIZER(silos);
* Add bans to silos
*/
static
void
static
int
smp_appendban
(
struct
smp_sc
*
sc
,
struct
smp_signspace
*
spc
,
uint32_t
len
,
const
uint8_t
*
ban
)
{
(
void
)
sc
;
assert
(
SIGNSPACE_FREE
(
spc
)
>=
len
);
if
(
SIGNSPACE_FREE
(
spc
)
<
len
)
return
(
-
1
);
memcpy
(
SIGNSPACE_FRONT
(
spc
),
ban
,
len
);
smp_append_signspace
(
spc
,
len
);
return
(
0
);
}
/* Trust that cache_ban.c takes care of locking */
static
void
static
int
smp_baninfo
(
struct
stevedore
*
stv
,
enum
baninfo
event
,
const
uint8_t
*
ban
,
unsigned
len
)
{
struct
smp_sc
*
sc
;
int
r
=
0
;
CAST_OBJ_NOTNULL
(
sc
,
stv
->
priv
,
SMP_SC_MAGIC
);
switch
(
event
)
{
case
BI_NEW
:
smp_appendban
(
sc
,
&
sc
->
ban1
,
len
,
ban
);
smp_appendban
(
sc
,
&
sc
->
ban2
,
len
,
ban
);
r
|=
smp_appendban
(
sc
,
&
sc
->
ban1
,
len
,
ban
);
r
|=
smp_appendban
(
sc
,
&
sc
->
ban2
,
len
,
ban
);
break
;
default:
/* Ignored */
break
;
}
return
(
r
);
}
/*--------------------------------------------------------------------
...
...
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