X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fht-cleanup.c;h=c477e1a649624fd38d9b82e4ec66ccc970689d28;hb=584fc280d529740882a24c87a431e547b5acf8e0;hp=57d6aec118bc6f5ac1df1df3057d63077b82b315;hpb=65da3cc731c72486d53d58c9b080f235121177d9;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ht-cleanup.c b/src/bin/lttng-sessiond/ht-cleanup.c index 57d6aec11..c477e1a64 100644 --- a/src/bin/lttng-sessiond/ht-cleanup.c +++ b/src/bin/lttng-sessiond/ht-cleanup.c @@ -106,32 +106,31 @@ restart: } assert(pollfd == ht_cleanup_pipe[0]); - if (revents & (LPOLLERR | LPOLLHUP | LPOLLRDHUP)) { + if (revents & LPOLLIN) { + /* Get socket from dispatch thread. */ + size_ret = lttng_read(ht_cleanup_pipe[0], &ht, + sizeof(ht)); + if (size_ret < sizeof(ht)) { + PERROR("ht cleanup notify pipe"); + goto error; + } + health_code_update(); + /* + * The whole point of this thread is to call + * lttng_ht_destroy from a context that is NOT: + * 1) a read-side RCU lock, + * 2) a call_rcu thread. + */ + lttng_ht_destroy(ht); + + health_code_update(); + } else if (revents & (LPOLLERR | LPOLLHUP | LPOLLRDHUP)) { ERR("ht cleanup pipe error"); goto error; - } else if (!(revents & LPOLLIN)) { - /* No POLLIN and not a catched error, stop the thread. */ - ERR("ht cleanup failed. revent: %u", revents); - goto error; - } - - /* Get socket from dispatch thread. */ - size_ret = lttng_read(ht_cleanup_pipe[0], &ht, - sizeof(ht)); - if (size_ret < sizeof(ht)) { - PERROR("ht cleanup notify pipe"); + } else { + ERR("Unexpected poll events %u for sock %d", revents, pollfd); goto error; } - health_code_update(); - /* - * The whole point of this thread is to call - * lttng_ht_destroy from a context that is NOT: - * 1) a read-side RCU lock, - * 2) a call_rcu thread. - */ - lttng_ht_destroy(ht); - - health_code_update(); } }