The ht-cleanup thread does not ensure that all data pending on its
ht_clean_pipe has been read (and processed) before processing the
"quit" event on the quit_pipe.
This causes a number of urcu hash tables to be leaked on exit of
the sessiond even though they have been pushed on the cleanup
pipe.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
health_code_update();
while (1) {
+ restart:
DBG3("[ht-thread] Polling.");
health_poll_entry();
ret = lttng_poll_wait(&events, -1);
lttng_ht_destroy(ht);
health_code_update();
+
+ /*
+ * Ensure that we never process the quit pipe
+ * event while there is still data available
+ * on the ht clean pipe.
+ */
+ goto restart;
} else if (revents & (LPOLLERR | LPOLLHUP | LPOLLRDHUP)) {
ERR("ht cleanup pipe error");
goto error;