Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trackrdrd
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
trackrdrd
Commits
594bc60a
Commit
594bc60a
authored
Feb 14, 2013
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trackrdrd: - corrected the termination condition
- now logging the varnish instance name - some code cleanup
parent
fe21d4ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
15 deletions
+23
-15
child.c
trackrdrd/src/child.c
+22
-14
regress.sh
trackrdrd/src/test/regress.sh
+1
-1
No files found.
trackrdrd/src/child.c
View file @
594bc60a
...
...
@@ -685,7 +685,7 @@ OSL_Track(void *priv, enum VSL_tag_e tag, unsigned fd, unsigned len,
(
void
)
bitmap
;
if
(
term
&&
htbl
.
open
==
0
)
return
1
;
return
0
;
if
(
wrk_running
<
config
.
nworkers
)
{
wrk_running
=
WRK_Running
();
...
...
@@ -701,7 +701,7 @@ OSL_Track(void *priv, enum VSL_tag_e tag, unsigned fd, unsigned len,
switch
(
tag
)
{
case
SLT_ReqStart
:
if
(
term
)
return
(
0
)
;
if
(
term
)
return
0
;
htbl
.
seen
++
;
err
=
Parse_ReqStart
(
ptr
,
len
,
&
xid
);
...
...
@@ -808,7 +808,7 @@ OSL_Track(void *priv, enum VSL_tag_e tag, unsigned fd, unsigned len,
}
pptr
=
ptr
;
return
(
0
)
;
return
0
;
}
/*--------------------------------------------------------------------*/
...
...
@@ -833,17 +833,14 @@ vsl_diag(void *priv, const char *fmt, ...)
va_end
(
ap
);
}
static
void
init_pthread_attrs
(
voi
d
)
static
const
char
*
vsm_name
(
struct
VSM_data
*
v
d
)
{
AZ
(
pthread_mutexattr_init
(
&
attr_lock
));
AZ
(
pthread_condattr_init
(
&
attr_cond
));
// important to make mutex/cv efficient
AZ
(
pthread_mutexattr_setpshared
(
&
attr_lock
,
PTHREAD_PROCESS_PRIVATE
));
AZ
(
pthread_condattr_setpshared
(
&
attr_cond
,
PTHREAD_PROCESS_PRIVATE
));
const
char
*
name
=
VSM_Name
(
vd
);
if
(
name
&&
*
name
)
return
name
;
else
return
"default"
;
}
void
...
...
@@ -854,7 +851,12 @@ CHILD_Main(struct VSM_data *vd, int endless, int readconfig)
pthread_t
monitor
;
struct
passwd
*
pw
;
init_pthread_attrs
();
AZ
(
pthread_mutexattr_init
(
&
attr_lock
));
AZ
(
pthread_condattr_init
(
&
attr_cond
));
// important to make mutex/cv efficient
AZ
(
pthread_mutexattr_setpshared
(
&
attr_lock
,
PTHREAD_PROCESS_PRIVATE
));
AZ
(
pthread_condattr_setpshared
(
&
attr_cond
,
PTHREAD_PROCESS_PRIVATE
));
MON_StatsInit
();
LOG_Log0
(
LOG_INFO
,
"Worker process starting"
);
...
...
@@ -902,6 +904,7 @@ CHILD_Main(struct VSM_data *vd, int endless, int readconfig)
VSM_Diag
(
vd
,
vsl_diag
,
NULL
);
if
(
VSL_Open
(
vd
,
1
))
exit
(
EXIT_FAILURE
);
LOG_Log
(
LOG_INFO
,
"Reading varnish instance %s"
,
vsm_name
(
vd
));
/* Only read the VSL tags relevant to tracking */
assert
(
VSL_Arg
(
vd
,
'i'
,
TRACK_TAGS
)
>
0
);
...
...
@@ -965,6 +968,11 @@ CHILD_Main(struct VSM_data *vd, int endless, int readconfig)
continue
;
}
if
(
term
)
LOG_Log0
(
LOG_INFO
,
"Termination signal received"
);
else
if
(
endless
)
LOG_Log0
(
LOG_WARNING
,
"Varnish log closed"
);
WRK_Halt
();
WRK_Shutdown
();
AZ
(
MQ_GlobalShutdown
());
...
...
trackrdrd/src/test/regress.sh
View file @
594bc60a
...
...
@@ -22,7 +22,7 @@ CMD="../trackrdrd -D -f varnish.binlog -l - -d -c test.conf"
# the user running it
CKSUM
=
$(
$CMD
|
sed
-e
's/\(initializing\) \(.*\)/\1/'
|
sed
-e
's/\(Running as\) \([a-zA-Z0-9]*\)$/\1/'
|
grep
-v
'Not running as root'
|
cksum
)
if
[
"
$CKSUM
"
!=
'
1346049411 234027
'
]
;
then
if
[
"
$CKSUM
"
!=
'
2485830008 234066
'
]
;
then
echo
"ERROR: Regression test incorrect cksum:
$CKSUM
"
exit
1
fi
...
...
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