ltt-sessiond teardown cleanup
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 8 Aug 2011 04:03:04 +0000 (00:03 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 8 Aug 2011 04:03:04 +0000 (00:03 -0400)
commitcf3af59ede4474f4e5123699ee2ee9ee85b7cadd
tree1d51069856e2f8ef5bb3e1a46daa123c2ef272d2
parent0ee893b93b55de38eeb673dbd41056d80f99d8a9
ltt-sessiond teardown cleanup

ltt-sessiond now kills (SIGTERM) the kconsumerd before exiting, so the
LTTng module unload succeeds. Previously, the kconsumerd was still
holding a reference on ltt-relay.ko -- it was only being released after
ltt-sessiond closed its communication socket with kconsumerd.

Now, all the teardown actually wakes each thread, getting them to
return, and main() joins each of them before calling cleanup().
Previously, we had no guarantee that threads would not run concurrently
with cleanup() executed from the signal handler.

It would still be good to audit _each_ read call so we ensure that they
are performed on O_NONBLOCK fcntl fds (as we did in the kconsumerd), so
all the blocking is done in a poll() call, which can be woken up by the
sessiond termination file descriptor too (from the signal handler).
Failure to respect this could lead to races where sessiond blocks on a
file descriptor and never really honour the signal for a thread, thus
leading to blocking of the main() thread on a join.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ltt-sessiond/main.c
This page took 0.024739 seconds and 4 git commands to generate.