Fix: remove consumer health poll update on startup
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index 859223a11216b1d342b0899ebdd4e66bc657d657..84b3f20ed5420b03210e8c80c4f638f4f5072d3b 100644 (file)
@@ -746,9 +746,9 @@ static void *thread_manage_kernel(void *data)
 
                /* Poll infinite value of time */
        restart:
-               health_poll_update();
+               health_poll_entry();
                ret = lttng_poll_wait(&events, -1);
-               health_poll_update();
+               health_poll_exit();
                if (ret < 0) {
                        /*
                         * Restart interrupted system call.
@@ -867,24 +867,7 @@ static void *thread_manage_consumer(void *data)
 
        health_register(HEALTH_TYPE_CONSUMER);
 
-       /*
-        * Since the consumer thread can be spawned at any moment in time, we init
-        * the health to a poll status (1, which is a valid health over time).
-        * When the thread starts, we update here the health to a "code" path being
-        * an even value so this thread, when reaching a poll wait, does not
-        * trigger an error with an even value.
-        *
-        * Here is the use case we avoid.
-        *
-        * +1: the first poll update during initialization (main())
-        * +2 * x: multiple code update once in this thread.
-        * +1: poll wait in this thread (being a good health state).
-        * == even number which after the wait period shows as a bad health.
-        *
-        * In a nutshell, the following poll update to the health state brings back
-        * the state to an even value meaning a code path.
-        */
-       health_poll_update();
+       health_code_update();
 
        /*
         * Pass 2 as size here for the thread quit pipe and kconsumerd_err_sock.
@@ -909,14 +892,14 @@ static void *thread_manage_consumer(void *data)
 
        /* Inifinite blocking call, waiting for transmission */
 restart:
-       health_poll_update();
+       health_poll_entry();
 
        if (testpoint(thread_manage_consumer)) {
                goto error;
        }
 
        ret = lttng_poll_wait(&events, -1);
-       health_poll_update();
+       health_poll_exit();
        if (ret < 0) {
                /*
                 * Restart interrupted system call.
@@ -1008,9 +991,9 @@ restart:
 
        /* Inifinite blocking call, waiting for transmission */
 restart_poll:
-       health_poll_update();
+       health_poll_entry();
        ret = lttng_poll_wait(&events, -1);
-       health_poll_update();
+       health_poll_exit();
        if (ret < 0) {
                /*
                 * Restart interrupted system call.
@@ -1150,9 +1133,9 @@ static void *thread_manage_apps(void *data)
 
                /* Inifinite blocking call, waiting for transmission */
        restart:
-               health_poll_update();
+               health_poll_entry();
                ret = lttng_poll_wait(&events, -1);
-               health_poll_update();
+               health_poll_exit();
                if (ret < 0) {
                        /*
                         * Restart interrupted system call.
@@ -1430,9 +1413,9 @@ static void *thread_registration_apps(void *data)
 
                /* Inifinite blocking call, waiting for transmission */
        restart:
-               health_poll_update();
+               health_poll_entry();
                ret = lttng_poll_wait(&events, -1);
-               health_poll_update();
+               health_poll_exit();
                if (ret < 0) {
                        /*
                         * Restart interrupted system call.
@@ -3208,9 +3191,9 @@ static void *thread_manage_clients(void *data)
 
                /* Inifinite blocking call, waiting for transmission */
        restart:
-               health_poll_update();
+               health_poll_entry();
                ret = lttng_poll_wait(&events, -1);
-               health_poll_update();
+               health_poll_exit();
                if (ret < 0) {
                        /*
                         * Restart interrupted system call.
This page took 0.024792 seconds and 4 git commands to generate.