All resources allocated by the consumerd before the launch
of the run-as worker process are leaked since the run-as process
is only fork()'ed (the original process image is preserved).
Moving the launch of the worker earlier in the initialization
of the consumerd works around this problem.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
rcu_register_thread();
+ if (run_as_create_worker(argv[0], NULL, NULL) < 0) {
+ goto exit_set_signal_handler;
+ }
+
if (set_signal_handler()) {
retval = -1;
goto exit_set_signal_handler;
set_ulimit();
}
- if (run_as_create_worker(argv[0], NULL, NULL) < 0) {
- goto exit_init_data;
- }
-
/* create the consumer instance with and assign the callbacks */
ctx = lttng_consumer_create(opt_type, lttng_consumer_read_subbuffer,
NULL, lttng_consumer_on_recv_stream, NULL);