Fix: stop lttng-relayd threads on health thread error
[lttng-tools.git] / src / bin / lttng-relayd / health-relayd.c
index d34a376c53989dd314cf217c0da52e7d69f1a3e4..f1354c195934f258f43a6c6ae49c4cf03d46b6da 100644 (file)
@@ -346,9 +346,14 @@ restart:
 
                        /* Event on the registration socket */
                        if (pollfd == sock) {
-                               if (revents & (LPOLLERR | LPOLLHUP | LPOLLRDHUP)) {
+                               if (revents & LPOLLIN) {
+                                       continue;
+                               } else if (revents & (LPOLLERR | LPOLLHUP | LPOLLRDHUP)) {
                                        ERR("Health socket poll error");
                                        goto error;
+                               } else {
+                                       ERR("Unexpected poll events %u for sock %d", revents, pollfd);
+                                       goto error;
                                }
                        }
                }
@@ -406,8 +411,9 @@ restart:
                new_sock = -1;
        }
 
-exit:
 error:
+       lttng_relay_stop_threads();
+exit:
        if (err) {
                ERR("Health error occurred in %s", __func__);
        }
This page took 0.024222 seconds and 4 git commands to generate.