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
7046979e
Commit
7046979e
authored
Apr 26, 2019
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Resolve race on waitinglist rushing between OC_F_BUSY and boc->state"
This reverts commit
4130055c
.
parent
cc06c227
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
15 deletions
+19
-15
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+15
-13
cache_hash.c
bin/varnishd/cache/cache_hash.c
+2
-2
cache_obj.c
bin/varnishd/cache/cache_obj.c
+1
-0
boc_state.h
include/tbl/boc_state.h
+1
-0
No files found.
bin/varnishd/cache/cache_fetch.c
View file @
7046979e
...
...
@@ -562,8 +562,9 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
assert
(
bo
->
fetch_objcore
->
boc
->
state
==
BOS_REQ_DONE
);
if
(
bo
->
do_stream
)
{
ObjSetState
(
wrk
,
bo
->
fetch_objcore
,
BOS_STREAM
);
ObjSetState
(
wrk
,
bo
->
fetch_objcore
,
BOS_
PREP_
STREAM
);
HSH_Unbusy
(
wrk
,
bo
->
fetch_objcore
);
ObjSetState
(
wrk
,
bo
->
fetch_objcore
,
BOS_STREAM
);
}
VSLb
(
bo
->
vsl
,
SLT_Fetch_Body
,
"%u %s %s"
,
...
...
@@ -588,20 +589,18 @@ vbf_stp_fetchend(struct worker *wrk, struct busyobj *bo)
AZ
(
ObjSetU64
(
wrk
,
bo
->
fetch_objcore
,
OA_LEN
,
bo
->
fetch_objcore
->
boc
->
len_so_far
));
/* Recycle the backend connection before setting BOS_FINISHED to
give predictable backend reuse behavior for varnishtest */
VDI_Finish
(
bo
);
if
(
bo
->
do_stream
)
assert
(
bo
->
fetch_objcore
->
boc
->
state
==
BOS_STREAM
);
else
else
{
assert
(
bo
->
fetch_objcore
->
boc
->
state
==
BOS_REQ_DONE
);
ObjSetState
(
wrk
,
bo
->
fetch_objcore
,
BOS_FINISHED
);
if
(
!
bo
->
do_stream
)
HSH_Unbusy
(
wrk
,
bo
->
fetch_objcore
);
AZ
(
bo
->
fetch_objcore
->
flags
&
OC_F_BUSY
);
}
/* Recycle the backend connection before setting BOS_FINISHED to
give predictable backend reuse behavior for varnishtest */
VDI_Finish
(
bo
);
ObjSetState
(
wrk
,
bo
->
fetch_objcore
,
BOS_FINISHED
);
VSLb_ts_busyobj
(
bo
,
"BerespBody"
,
W_TIM_real
(
wrk
));
if
(
bo
->
stale_oc
!=
NULL
)
HSH_Kill
(
bo
->
stale_oc
);
...
...
@@ -655,8 +654,9 @@ vbf_stp_condfetch(struct worker *wrk, struct busyobj *bo)
AZ
(
ObjCopyAttr
(
bo
->
wrk
,
bo
->
fetch_objcore
,
bo
->
stale_oc
,
OA_GZIPBITS
));
if
(
bo
->
do_stream
)
{
ObjSetState
(
wrk
,
bo
->
fetch_objcore
,
BOS_STREAM
);
ObjSetState
(
wrk
,
bo
->
fetch_objcore
,
BOS_
PREP_
STREAM
);
HSH_Unbusy
(
wrk
,
bo
->
fetch_objcore
);
ObjSetState
(
wrk
,
bo
->
fetch_objcore
,
BOS_STREAM
);
}
if
(
ObjIterate
(
wrk
,
bo
->
stale_oc
,
bo
,
vbf_objiterator
,
0
))
...
...
@@ -790,10 +790,10 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo)
}
AZ
(
ObjSetU64
(
wrk
,
bo
->
fetch_objcore
,
OA_LEN
,
o
));
VSB_destroy
(
&
synth_body
);
ObjSetState
(
wrk
,
bo
->
fetch_objcore
,
BOS_FINISHED
);
HSH_Unbusy
(
wrk
,
bo
->
fetch_objcore
);
if
(
stale
!=
NULL
&&
bo
->
fetch_objcore
->
ttl
>
0
)
HSH_Kill
(
stale
);
ObjSetState
(
wrk
,
bo
->
fetch_objcore
,
BOS_FINISHED
);
return
(
F_STP_DONE
);
}
...
...
@@ -808,10 +808,10 @@ vbf_stp_fail(struct worker *wrk, const struct busyobj *bo)
CHECK_OBJ_NOTNULL
(
bo
->
fetch_objcore
,
OBJCORE_MAGIC
);
assert
(
bo
->
fetch_objcore
->
boc
->
state
<
BOS_FINISHED
);
ObjSetState
(
wrk
,
bo
->
fetch_objcore
,
BOS_FAILED
);
HSH_Fail
(
bo
->
fetch_objcore
);
if
(
!
(
bo
->
fetch_objcore
->
flags
&
OC_F_BUSY
))
HSH_Kill
(
bo
->
fetch_objcore
);
ObjSetState
(
wrk
,
bo
->
fetch_objcore
,
BOS_FAILED
);
return
(
F_STP_DONE
);
}
...
...
@@ -982,6 +982,8 @@ VBF_Fetch(struct worker *wrk, struct req *req, struct objcore *oc,
ObjWaitState
(
oc
,
BOS_STREAM
);
if
(
oc
->
boc
->
state
==
BOS_FAILED
)
{
AN
((
oc
->
flags
&
OC_F_FAILED
));
}
else
{
AZ
(
oc
->
flags
&
OC_F_BUSY
);
}
}
}
...
...
bin/varnishd/cache/cache_hash.c
View file @
7046979e
...
...
@@ -420,11 +420,11 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp)
continue
;
CHECK_OBJ_ORNULL
(
oc
->
boc
,
BOC_MAGIC
);
if
(
oc
->
flags
&
OC_F_BUSY
)
{
if
(
oc
->
boc
!=
NULL
&&
oc
->
boc
->
state
<
BOS_STREAM
)
{
if
(
req
->
hash_ignore_busy
)
continue
;
if
(
oc
->
boc
!=
NULL
&&
oc
->
boc
->
vary
!=
NULL
&&
if
(
oc
->
boc
->
vary
!=
NULL
&&
!
VRY_Match
(
req
,
oc
->
boc
->
vary
))
continue
;
...
...
bin/varnishd/cache/cache_obj.c
View file @
7046979e
...
...
@@ -267,6 +267,7 @@ ObjSetState(struct worker *wrk, const struct objcore *oc,
assert
(
next
>
oc
->
boc
->
state
);
CHECK_OBJ_ORNULL
(
oc
->
stobj
->
stevedore
,
STEVEDORE_MAGIC
);
assert
(
next
!=
BOS_STREAM
||
oc
->
boc
->
state
==
BOS_PREP_STREAM
);
assert
(
next
!=
BOS_FINISHED
||
(
oc
->
oa_present
&
(
1
<<
OA_LEN
)));
if
(
oc
->
stobj
->
stevedore
!=
NULL
)
{
...
...
include/tbl/boc_state.h
View file @
7046979e
...
...
@@ -30,6 +30,7 @@
BOC_STATE
(
INVALID
,
invalid
)
/* don't touch (yet) */
BOC_STATE
(
REQ_DONE
,
req_done
)
/* bereq.* can be examined */
BOC_STATE
(
PREP_STREAM
,
prep_stream
)
/* Prepare for streaming */
BOC_STATE
(
STREAM
,
stream
)
/* beresp.* can be examined */
BOC_STATE
(
FINISHED
,
finished
)
/* object is complete */
BOC_STATE
(
FAILED
,
failed
)
/* something went wrong */
...
...
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