From: Mathieu Desnoyers Date: Mon, 8 Aug 2011 04:03:04 +0000 (-0400) Subject: ltt-sessiond teardown cleanup X-Git-Tag: v2.0-pre8~6 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=cf3af59ede4474f4e5123699ee2ee9ee85b7cadd;hp=cf3af59ede4474f4e5123699ee2ee9ee85b7cadd 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 ---