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
afed0f61
Commit
afed0f61
authored
May 20, 2013
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let req_fsm deref its own bo->ref on failure
parent
2eb5e555
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+0
-4
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+8
-5
No files found.
bin/varnishd/cache/cache_fetch.c
View file @
afed0f61
...
@@ -753,7 +753,6 @@ cnt_fetch(struct worker *wrk, struct req *req, struct busyobj *bo)
...
@@ -753,7 +753,6 @@ cnt_fetch(struct worker *wrk, struct req *req, struct busyobj *bo)
assert
(
bo
->
refcount
==
2
);
assert
(
bo
->
refcount
==
2
);
bo
->
storage_hint
=
NULL
;
bo
->
storage_hint
=
NULL
;
VBO_DerefBusyObj
(
wrk
,
&
bo
);
VBO_DerefBusyObj
(
wrk
,
&
bo
);
VBO_DerefBusyObj
(
wrk
,
&
req
->
busyobj
);
req
->
director
=
NULL
;
req
->
director
=
NULL
;
switch
(
wrk
->
handling
)
{
switch
(
wrk
->
handling
)
{
...
@@ -881,7 +880,6 @@ VBF_Fetch(struct worker *wrk, struct req *req)
...
@@ -881,7 +880,6 @@ VBF_Fetch(struct worker *wrk, struct req *req)
AZ
(
HSH_Deref
(
&
wrk
->
stats
,
req
->
objcore
,
NULL
));
AZ
(
HSH_Deref
(
&
wrk
->
stats
,
req
->
objcore
,
NULL
));
req
->
objcore
=
NULL
;
req
->
objcore
=
NULL
;
VDI_CloseFd
(
&
bo
->
vbc
);
VDI_CloseFd
(
&
bo
->
vbc
);
VBO_DerefBusyObj
(
wrk
,
&
req
->
busyobj
);
return
(
-
1
);
return
(
-
1
);
}
else
}
else
/* No vary */
/* No vary */
...
@@ -919,7 +917,6 @@ VBF_Fetch(struct worker *wrk, struct req *req)
...
@@ -919,7 +917,6 @@ VBF_Fetch(struct worker *wrk, struct req *req)
AZ
(
HSH_Deref
(
&
wrk
->
stats
,
req
->
objcore
,
NULL
));
AZ
(
HSH_Deref
(
&
wrk
->
stats
,
req
->
objcore
,
NULL
));
req
->
objcore
=
NULL
;
req
->
objcore
=
NULL
;
VDI_CloseFd
(
&
bo
->
vbc
);
VDI_CloseFd
(
&
bo
->
vbc
);
VBO_DerefBusyObj
(
wrk
,
&
req
->
busyobj
);
return
(
-
1
);
return
(
-
1
);
}
}
CHECK_OBJ_NOTNULL
(
req
->
obj
,
OBJECT_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
->
obj
,
OBJECT_MAGIC
);
...
@@ -996,7 +993,6 @@ VBF_Fetch(struct worker *wrk, struct req *req)
...
@@ -996,7 +993,6 @@ VBF_Fetch(struct worker *wrk, struct req *req)
}
else
if
(
bo
->
state
==
BOS_FAILED
)
{
}
else
if
(
bo
->
state
==
BOS_FAILED
)
{
/* handle early failures */
/* handle early failures */
(
void
)
HSH_Deref
(
&
wrk
->
stats
,
NULL
,
&
req
->
obj
);
(
void
)
HSH_Deref
(
&
wrk
->
stats
,
NULL
,
&
req
->
obj
);
VBO_DerefBusyObj
(
wrk
,
&
req
->
busyobj
);
return
(
-
1
);
return
(
-
1
);
}
}
...
...
bin/varnishd/cache/cache_req_fsm.c
View file @
afed0f61
...
@@ -356,14 +356,17 @@ cnt_fetch(struct worker *wrk, struct req *req)
...
@@ -356,14 +356,17 @@ cnt_fetch(struct worker *wrk, struct req *req)
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
i
=
VBF_Fetch
(
wrk
,
req
);
i
=
VBF_Fetch
(
wrk
,
req
);
if
(
i
<
0
)
{
if
(
i
==
0
)
{
assert
(
WRW_IsReleased
(
wrk
));
req
->
req_step
=
R_STP_PREPRESP
;
}
else
if
(
i
<
0
)
{
VBO_DerefBusyObj
(
wrk
,
&
req
->
busyobj
);
req
->
err_code
=
503
;
req
->
err_code
=
503
;
req
->
req_step
=
R_STP_ERROR
;
req
->
req_step
=
R_STP_ERROR
;
}
else
if
(
i
==
1
)
{
req
->
req_step
=
R_STP_RESTART
;
}
else
{
}
else
{
assert
(
WRW_IsReleased
(
wrk
));
VBO_DerefBusyObj
(
wrk
,
&
req
->
busyobj
);
req
->
req_step
=
R_STP_PREPRESP
;
assert
(
i
==
1
);
req
->
req_step
=
R_STP_RESTART
;
}
}
return
(
REQ_FSM_MORE
);
return
(
REQ_FSM_MORE
);
}
}
...
...
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