Improve handling of test SIGTERM/SIGINT (v2)
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 16 May 2019 19:07:56 +0000 (15:07 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 5 Sep 2019 17:44:01 +0000 (13:44 -0400)
commit529bb942d15366eacc37f14df5d4404dfcd64893
tree454a08b8a389b7e8032471f46d7626abd329f8eb
parent8c865d87ff9d07d8a4a52e055855c5e2e9a2ab0b
Improve handling of test SIGTERM/SIGINT (v2)

The current state of signal handling for test scripts is: on
SIGTERM/SIGINT of the tests (e.g. a CTRL-C on the console), session
daemon and relay daemon are killed with SIGKILL, thus leaking all their
resources, and leaving lttng kernel modules loaded.

Revamp the "stop" functions to take a signal number and a timeout
as optional parameters. The default signal number is SIGTERM.

The full_cleanup trap handler now tries to nicely kill relayd and
sessiond (if they are present) with SIGTERM, and wait up to the
user-configurable LTTNG_TEST_TEARDOWN_TIMEOUT environment variable
(which has a default of 60s). Then, if there are still either relayd,
sessiond, or consumerd present, it will SIGKILL them and wait for
them to vanish. If it had to kill sessiond with SIGKILL, it will
also explicitly try to unload the lttng modules with modprobe.

This approach is inspired from sysv init script shutdown behavior.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/utils/utils.sh
This page took 0.026264 seconds and 5 git commands to generate.