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
743c0615
Commit
743c0615
authored
Apr 07, 2018
by
Poul-Henning Kamp
Committed by
Dridi Boukelmoune
Jun 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try even harder to kill haproxy during cleanup
parent
c4e07ea1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
vtc_haproxy.c
bin/varnishtest/vtc_haproxy.c
+12
-10
No files found.
bin/varnishtest/vtc_haproxy.c
View file @
743c0615
...
@@ -70,8 +70,7 @@ struct haproxy {
...
@@ -70,8 +70,7 @@ struct haproxy {
pthread_t
tp
;
pthread_t
tp
;
int
expect_exit
;
int
expect_exit
;
int
expect_signal
;
int
expect_signal
;
int
kill_status
;
int
its_dead_jim
;
int
kill_errno
;
const
char
*
cli_fn
;
const
char
*
cli_fn
;
...
@@ -213,7 +212,9 @@ haproxy_thread(void *priv)
...
@@ -213,7 +212,9 @@ haproxy_thread(void *priv)
struct
haproxy
*
h
;
struct
haproxy
*
h
;
CAST_OBJ_NOTNULL
(
h
,
priv
,
HAPROXY_MAGIC
);
CAST_OBJ_NOTNULL
(
h
,
priv
,
HAPROXY_MAGIC
);
return
(
vtc_record
(
h
->
vl
,
h
->
fds
[
0
],
h
->
msgs
));
(
void
)
vtc_record
(
h
->
vl
,
h
->
fds
[
0
],
h
->
msgs
);
h
->
its_dead_jim
=
1
;
return
(
NULL
);
}
}
/**********************************************************************
/**********************************************************************
...
@@ -311,6 +312,7 @@ static void
...
@@ -311,6 +312,7 @@ static void
haproxy_wait
(
struct
haproxy
*
h
)
haproxy_wait
(
struct
haproxy
*
h
)
{
{
void
*
p
;
void
*
p
;
int
i
;
vtc_log
(
h
->
vl
,
2
,
"Wait"
);
vtc_log
(
h
->
vl
,
2
,
"Wait"
);
...
@@ -319,16 +321,16 @@ haproxy_wait(struct haproxy *h)
...
@@ -319,16 +321,16 @@ haproxy_wait(struct haproxy *h)
closefd
(
&
h
->
fds
[
1
]);
closefd
(
&
h
->
fds
[
1
]);
if
(
!
h
->
opt_check_mode
)
{
while
(
!
h
->
opt_check_mode
&&
!
h
->
its_dead_jim
)
{
assert
(
h
->
pid
>
0
);
assert
(
h
->
pid
>
0
);
vtc_log
(
h
->
vl
,
2
,
"Stop HAproxy pid=%ld"
,
(
long
)
h
->
pid
);
vtc_log
(
h
->
vl
,
2
,
"Stop HAproxy pid=%ld"
,
(
long
)
h
->
pid
);
h
->
kill_status
=
kill
(
h
->
pid
,
HAPROXY_SIGNAL
);
i
=
kill
(
h
->
pid
,
HAPROXY_SIGNAL
);
h
->
kill_errno
=
errno
;
if
(
h
->
kill_status
)
vtc_log
(
h
->
vl
,
4
,
"Kill=%d: %s"
,
h
->
kill_status
,
strerror
(
h
->
kill_errno
));
h
->
expect_signal
=
-
HAPROXY_SIGNAL
;
h
->
expect_signal
=
-
HAPROXY_SIGNAL
;
// XXX: loop over kills to ESRCH ?
if
(
i
&&
errno
==
ESRCH
)
break
;
if
(
i
)
vtc_log
(
h
->
vl
,
4
,
"Kill=%d: %s"
,
i
,
strerror
(
errno
));
usleep
(
100000
);
}
}
AZ
(
pthread_join
(
h
->
tp
,
&
p
));
AZ
(
pthread_join
(
h
->
tp
,
&
p
));
...
...
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