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
b135934f
Commit
b135934f
authored
Mar 14, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a race when we Unbusy and abandonned oc which has no object.
Fixes #1449
parent
e177b462
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+1
-2
cache_hash.c
bin/varnishd/cache/cache_hash.c
+8
-1
No files found.
bin/varnishd/cache/cache_fetch.c
View file @
b135934f
...
...
@@ -682,10 +682,9 @@ vbf_stp_fail(struct worker *wrk, struct busyobj *bo)
CHECK_OBJ_NOTNULL
(
bo
->
fetch_objcore
,
OBJCORE_MAGIC
);
assert
(
bo
->
state
<
BOS_FINISHED
);
bo
->
fetch_objcore
->
flags
|=
OC_F_PRIVATE
;
HSH_Fail
(
bo
->
fetch_objcore
)
;
if
(
bo
->
fetch_objcore
->
flags
&
OC_F_BUSY
)
HSH_Unbusy
(
&
wrk
->
stats
,
bo
->
fetch_objcore
);
HSH_Fail
(
bo
->
fetch_objcore
);
wrk
->
stats
.
fetch_failed
++
;
VBO_setstate
(
bo
,
BOS_FAILED
);
return
(
F_STP_DONE
);
...
...
bin/varnishd/cache/cache_hash.c
View file @
b135934f
...
...
@@ -629,6 +629,13 @@ HSH_Fail(struct objcore *oc)
oh
=
oc
->
objhead
;
CHECK_OBJ
(
oh
,
OBJHEAD_MAGIC
);
/*
* We have to have either a busy bit, so that HSH_Lookup
* will not consider this oc, or an object hung of the oc
* so that it can consider it.
*/
assert
((
oc
->
flags
&
OC_F_BUSY
)
||
(
oc
->
methods
!=
NULL
));
Lck_Lock
(
&
oh
->
mtx
);
oc
->
flags
|=
OC_F_FAILED
;
Lck_Unlock
(
&
oh
->
mtx
);
...
...
@@ -678,7 +685,7 @@ HSH_Unbusy(struct dstat *ds, struct objcore *oc)
if
(
oh
->
waitinglist
!=
NULL
)
hsh_rush
(
ds
,
oh
);
Lck_Unlock
(
&
oh
->
mtx
);
if
(
!
(
oc
->
flags
&
OC_F_PRIVATE
))
{
if
(
!
(
oc
->
flags
&
OC_F_PRIVATE
)
&&
oc
->
methods
!=
NULL
)
{
BAN_NewObjCore
(
oc
);
EXP_Insert
(
oc
);
AN
(
oc
->
flags
&
OC_F_EXP
);
...
...
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