From mboxrd@z Thu Jan 1 00:00:00 1970 From: jonathan.rajotte-julien@efficios.com (Jonathan Rajotte) Date: Mon, 18 Sep 2017 18:52:02 -0400 Subject: [lttng-dev] [RFC PATCH v2 09/13] Perform ust_app_unregister on thread_manage_apps teardown In-Reply-To: <20170918225206.17725-1-jonathan.rajotte-julien@efficios.com> References: <20170918225206.17725-1-jonathan.rajotte-julien@efficios.com> Message-ID: <20170918225206.17725-10-jonathan.rajotte-julien@efficios.com> Previous work on thread termination ordering permits the dismissal of the following comment: We don't clean the UST app hash table here since already registered applications can still be controlled so let them be until the session daemon dies or the applications stop. At the moment of termination control thread are already terminated. Signed-off-by: Jonathan Rajotte --- src/bin/lttng-sessiond/main.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 8cffa6f6..4a2a661f 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -1780,11 +1780,15 @@ error_testpoint: utils_close_pipe(apps_cmd_pipe); apps_cmd_pipe[0] = apps_cmd_pipe[1] = -1; - /* - * We don't clean the UST app hash table here since already registered - * applications can still be controlled so let them be until the session - * daemon dies or the applications stop. - */ + { + struct lttng_ht_iter iter; + struct ust_app *app; + rcu_read_lock(); + cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) { + ust_app_unregister(app->sock); + } + rcu_read_unlock(); + } if (err) { health_error(); -- 2.11.0