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
42e15a10
Commit
42e15a10
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
Escalate the signals if HAproxy refuses to die
parent
743c0615
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
vtc_haproxy.c
bin/varnishtest/vtc_haproxy.c
+20
-8
No files found.
bin/varnishtest/vtc_haproxy.c
View file @
42e15a10
...
...
@@ -312,7 +312,7 @@ static void
haproxy_wait
(
struct
haproxy
*
h
)
{
void
*
p
;
int
i
;
int
i
,
n
,
sig
;
vtc_log
(
h
->
vl
,
2
,
"Wait"
);
...
...
@@ -321,16 +321,28 @@ haproxy_wait(struct haproxy *h)
closefd
(
&
h
->
fds
[
1
]);
sig
=
SIGINT
;
n
=
0
;
vtc_log
(
h
->
vl
,
2
,
"Stop HAproxy pid=%ld"
,
(
long
)
h
->
pid
);
while
(
!
h
->
opt_check_mode
&&
!
h
->
its_dead_jim
)
{
assert
(
h
->
pid
>
0
);
vtc_log
(
h
->
vl
,
2
,
"Stop HAproxy pid=%ld"
,
(
long
)
h
->
pid
);
i
=
kill
(
h
->
pid
,
HAPROXY_SIGNAL
);
h
->
expect_signal
=
-
HAPROXY_SIGNAL
;
if
(
i
&&
errno
==
ESRCH
)
break
;
if
(
i
)
vtc_log
(
h
->
vl
,
4
,
"Kill=%d: %s"
,
i
,
strerror
(
errno
));
if
(
n
==
0
)
{
i
=
kill
(
h
->
pid
,
sig
);
vtc_log
(
h
->
vl
,
4
,
"Kill(%d)=%d: %s"
,
sig
,
i
,
strerror
(
errno
));
h
->
expect_signal
=
-
sig
;
if
(
i
&&
errno
==
ESRCH
)
break
;
}
usleep
(
100000
);
if
(
++
n
==
20
)
{
switch
(
sig
)
{
case
SIGINT
:
sig
=
SIGTERM
;
break
;
case
SIGTERM
:
sig
=
SIGKILL
;
break
;
default:
break
;
}
n
=
0
;
}
}
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