Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
87f32cb7
Commit
87f32cb7
authored
Jun 25, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always release req before calling SES_Delete()
Split SES_Handle() and SES_ScheduleReq().
parent
94d7a686
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
21 deletions
+28
-21
cache.h
bin/varnishd/cache/cache.h
+1
-1
cache_center.c
bin/varnishd/cache/cache_center.c
+4
-0
cache_hash.c
bin/varnishd/cache/cache_hash.c
+2
-5
cache_session.c
bin/varnishd/cache/cache_session.c
+21
-15
No files found.
bin/varnishd/cache/cache.h
View file @
87f32cb7
...
...
@@ -928,7 +928,7 @@ void SES_Delete(struct sess *sp, const char *reason, double now);
void
SES_Charge
(
struct
worker
*
,
struct
req
*
);
struct
sesspool
*
SES_NewPool
(
struct
pool
*
pp
,
unsigned
pool_no
);
void
SES_DeletePool
(
struct
sesspool
*
sp
);
int
SES_Schedule
(
struct
sess
*
sp
);
int
SES_Schedule
Req
(
struct
req
*
);
void
SES_Handle
(
struct
sess
*
sp
,
double
now
);
struct
req
*
SES_GetReq
(
struct
sess
*
sp
);
void
SES_ReleaseReq
(
struct
req
*
);
...
...
bin/varnishd/cache/cache_center.c
View file @
87f32cb7
...
...
@@ -207,6 +207,8 @@ cnt_wait(struct sess *sp, struct worker *wrk, struct req *req)
}
}
SES_Charge
(
wrk
,
req
);
AZ
(
req
->
vcl
);
SES_ReleaseReq
(
req
);
SES_Delete
(
sp
,
why
,
now
);
return
(
1
);
}
...
...
@@ -295,6 +297,8 @@ cnt_sess_done(struct sess *sp, struct worker *wrk, struct req *req)
if
(
sp
->
fd
<
0
)
{
wrk
->
stats
.
sess_closed
++
;
AZ
(
req
->
vcl
);
SES_ReleaseReq
(
req
);
SES_Delete
(
sp
,
NULL
,
NAN
);
return
(
SESS_DONE_RET_GONE
);
}
...
...
bin/varnishd/cache/cache_hash.c
View file @
87f32cb7
...
...
@@ -469,7 +469,6 @@ hsh_rush(struct dstat *ds, struct objhead *oh)
{
unsigned
u
;
struct
req
*
req
;
struct
sess
*
sp
;
struct
waitinglist
*
wl
;
CHECK_OBJ_NOTNULL
(
oh
,
OBJHEAD_MAGIC
);
...
...
@@ -482,11 +481,9 @@ hsh_rush(struct dstat *ds, struct objhead *oh)
break
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
AZ
(
req
->
wrk
);
sp
=
req
->
sp
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
VTAILQ_REMOVE
(
&
wl
->
list
,
req
,
w_list
);
DSL
(
0x20
,
SLT_Debug
,
sp
->
vsl_id
,
"off waiting list"
);
if
(
SES_Schedule
(
sp
))
{
DSL
(
0x20
,
SLT_Debug
,
req
->
sp
->
vsl_id
,
"off waiting list"
);
if
(
SES_Schedule
Req
(
req
))
{
/*
* We could not schedule the session, leave the
* rest on the busy list.
...
...
bin/varnishd/cache/cache_session.c
View file @
87f32cb7
...
...
@@ -169,14 +169,17 @@ SES_pool_accept_task(struct worker *wrk, void *arg)
}
/*--------------------------------------------------------------------
* Schedule a
session back on a work-thread from it
s pool
* Schedule a
request back on a work-thread from its session
s pool
*/
int
SES_Schedule
(
struct
sess
*
sp
)
SES_Schedule
Req
(
struct
req
*
req
)
{
struct
sess
*
sp
;
struct
sesspool
*
pp
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
sp
=
req
->
sp
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
pp
=
sp
->
sesspool
;
CHECK_OBJ_NOTNULL
(
pp
,
SESSPOOL_MAGIC
);
...
...
@@ -188,13 +191,8 @@ SES_Schedule(struct sess *sp)
if
(
Pool_Task
(
pp
->
pool
,
&
sp
->
task
,
POOL_QUEUE_FRONT
))
{
VSC_C_main
->
client_drop_late
++
;
sp
->
t_idle
=
VTIM_real
();
if
(
sp
->
req
!=
NULL
&&
sp
->
req
->
vcl
!=
NULL
)
{
/*
* A session parked on a busy object can come here
* after it wakes up. Loose the VCL reference.
*/
VCL_Rel
(
&
sp
->
req
->
vcl
);
}
AN
(
req
->
vcl
);
VCL_Rel
(
&
req
->
vcl
);
SES_Delete
(
sp
,
"dropped"
,
sp
->
t_idle
);
return
(
1
);
}
...
...
@@ -208,10 +206,22 @@ SES_Schedule(struct sess *sp)
void
SES_Handle
(
struct
sess
*
sp
,
double
now
)
{
struct
sesspool
*
pp
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
pp
=
sp
->
sesspool
;
CHECK_OBJ_NOTNULL
(
pp
,
SESSPOOL_MAGIC
);
AN
(
pp
->
pool
);
AZ
(
sp
->
req
);
sp
->
task
.
func
=
ses_pool_task
;
sp
->
task
.
priv
=
sp
;
sp
->
sess_step
=
S_STP_NEWREQ
;
sp
->
t_rx
=
now
;
(
void
)
SES_Schedule
(
sp
);
if
(
Pool_Task
(
pp
->
pool
,
&
sp
->
task
,
POOL_QUEUE_FRONT
))
{
VSC_C_main
->
client_drop_late
++
;
sp
->
t_idle
=
VTIM_real
();
SES_Delete
(
sp
,
"dropped"
,
sp
->
t_idle
);
}
}
/*--------------------------------------------------------------------
...
...
@@ -248,6 +258,7 @@ SES_Delete(struct sess *sp, const char *reason, double now)
struct
sesspool
*
pp
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
AZ
(
sp
->
req
);
pp
=
sp
->
sesspool
;
CHECK_OBJ_NOTNULL
(
pp
,
SESSPOOL_MAGIC
);
AN
(
pp
->
pool
);
...
...
@@ -259,11 +270,6 @@ SES_Delete(struct sess *sp, const char *reason, double now)
assert
(
!
isnan
(
sp
->
t_open
));
assert
(
sp
->
fd
<
0
);
if
(
sp
->
req
!=
NULL
)
{
AZ
(
sp
->
req
->
vcl
);
SES_ReleaseReq
(
sp
->
req
);
}
if
(
*
sp
->
addr
==
'\0'
)
strcpy
(
sp
->
addr
,
"-"
);
if
(
*
sp
->
port
==
'\0'
)
...
...
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