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.5.3~44 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=aa7102d7b77e8db772ae1656e4435b2ddd67537c;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 d0b799ed8..832afa585 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -2426,6 +2426,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"); @@ -2657,6 +2658,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);