Fix: call lttng_poll_set_max_size before start threads
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 5 Jan 2015 21:43:06 +0000 (16:43 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 8 Jan 2015 20:25:03 +0000 (15:25 -0500)
This changes the location of lttng_poll_set_max_size() call within
sessiond main() to call it before creating the ht_cleanup thread. This
fix is only needed on top of the main refactoring patch.

This fix also adds checks for lttng_poll_set_max_size() error values.

Fixes #747

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-consumerd/lttng-consumerd.c
src/bin/lttng-relayd/live.c
src/bin/lttng-relayd/main.c
src/bin/lttng-sessiond/main.c

index b43e8f1503869c857889f85ba177fd95357ec9b6..7122d065e649aa41533d4319af9d88010d4b4890 100644 (file)
@@ -346,7 +346,10 @@ int main(int argc, char **argv)
        }
 
        /* Set up max poll set size */
-       lttng_poll_set_max_size();
+       if (lttng_poll_set_max_size()) {
+               retval = -1;
+               goto exit_init_data;
+       }
 
        if (*command_sock_path == '\0') {
                switch (opt_type) {
index 756efbedef8434c7126148a7fbdb09e28c57e1e5..3728005df77c3efa3d7c9e20f5ca537db26940bf 100644 (file)
@@ -2102,7 +2102,10 @@ int relayd_live_create(struct lttng_uri *uri,
        cds_wfcq_init(&viewer_conn_queue.head, &viewer_conn_queue.tail);
 
        /* Set up max poll set size */
-       lttng_poll_set_max_size();
+       if (lttng_poll_set_max_size()) {
+               retval = -1;
+               goto exit_init_data;
+       }
 
        /* Setup the dispatcher thread */
        ret = pthread_create(&live_dispatcher_thread, NULL,
index 94bb4cb8e6a1ea24924e96e449dbb0c610aee85e..d09b0c6e7481872a51317593f1abde30b0e59664 100644 (file)
@@ -2850,7 +2850,10 @@ int main(int argc, char **argv)
        cds_wfcq_init(&relay_conn_queue.head, &relay_conn_queue.tail);
 
        /* Set up max poll set size */
-       lttng_poll_set_max_size();
+       if (lttng_poll_set_max_size()) {
+               retval = -1;
+               goto exit_init_data;
+       }
 
        /* Initialize communication library */
        lttcomm_init();
index 80eebf163a10af74b1edfdc1069ccd830050bdbb..5fcd540e5314bd5ab80b522e2627f5e9d96ea81d 100644 (file)
@@ -5205,6 +5205,12 @@ int main(int argc, char **argv)
                goto exit_ht_cleanup_pipe;
        }
 
+       /* Set up max poll set size */
+       if (lttng_poll_set_max_size()) {
+               retval = -1;
+               goto exit_set_max_size;
+       }
+
        /* Create thread to clean up RCU hash tables */
        ret = pthread_create(&ht_cleanup_thread, NULL,
                        thread_ht_cleanup, (void *) NULL);
@@ -5539,9 +5545,6 @@ int main(int argc, char **argv)
         */
        session_list_ptr = session_get_list();
 
-       /* Set up max poll set size */
-       lttng_poll_set_max_size();
-
        cmd_init();
 
        /* Check for the application socket timeout env variable. */
@@ -5771,6 +5774,7 @@ exit_init_data:
                retval = -1;
        }
 exit_ht_cleanup:
+exit_set_max_size:
 
        utils_close_pipe(ht_cleanup_pipe);
 exit_ht_cleanup_pipe:
This page took 0.033894 seconds and 4 git commands to generate.