From: Julien Desfossez Date: Tue, 11 Nov 2014 20:57:48 +0000 (-0500) Subject: Fix: empty indexes_ht before destroying it. X-Git-Tag: v2.4.3~33 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6eb157796a0f30b063dc991e2464adc69f96acb6;p=lttng-tools.git Fix: empty indexes_ht before destroying it. Fixes: #722 Signed-off-by: Julien Desfossez Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 75f2d9193..7c6212444 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -2286,6 +2286,7 @@ void *relay_thread_worker(void *data) struct lttcomm_relayd_hdr recv_hdr; struct relay_local_data *relay_ctx = (struct relay_local_data *) data; struct lttng_ht *sessions_ht = relay_ctx->sessions_ht; + struct relay_index *index; DBG("[thread] Relay worker started"); @@ -2517,6 +2518,14 @@ error: } rcu_read_unlock(); error_poll_create: + rcu_read_lock(); + cds_lfht_for_each_entry(indexes_ht->ht, &iter.iter, index, + index_n.node) { + health_code_update(); + relay_index_delete(index); + relay_index_free_safe(index); + } + rcu_read_unlock(); lttng_ht_destroy(indexes_ht); indexes_ht_error: lttng_ht_destroy(relay_connections_ht);