projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: consumerd main: needs to be a registered RCU thread
[lttng-tools.git]
/
src
/
bin
/
lttng-consumerd
/
lttng-consumerd.c
diff --git
a/src/bin/lttng-consumerd/lttng-consumerd.c
b/src/bin/lttng-consumerd/lttng-consumerd.c
index 1636b9c0d22777798ff220df010c4bc5ca6c9634..2f8eed1085dfed209ba5f00979621e2f603d44be 100644
(file)
--- a/
src/bin/lttng-consumerd/lttng-consumerd.c
+++ b/
src/bin/lttng-consumerd/lttng-consumerd.c
@@
-99,14
+99,6
@@
static void sighandler(int sig)
return;
}
return;
}
- /*
- * Ignore SIGPIPE because it should not stop the consumer whenever a
- * SIGPIPE is caught through a FD operation.
- */
- if (sig == SIGPIPE) {
- return;
- }
-
if (ctx) {
lttng_consumer_should_exit(ctx);
}
if (ctx) {
lttng_consumer_should_exit(ctx);
}
@@
-127,9
+119,10
@@
static int set_signal_handler(void)
return ret;
}
return ret;
}
- sa.sa_handler = sighandler;
sa.sa_mask = sigset;
sa.sa_flags = 0;
sa.sa_mask = sigset;
sa.sa_flags = 0;
+
+ sa.sa_handler = sighandler;
if ((ret = sigaction(SIGTERM, &sa, NULL)) < 0) {
PERROR("sigaction");
return ret;
if ((ret = sigaction(SIGTERM, &sa, NULL)) < 0) {
PERROR("sigaction");
return ret;
@@
-140,6
+133,7
@@
static int set_signal_handler(void)
return ret;
}
return ret;
}
+ sa.sa_handler = SIG_IGN;
if ((ret = sigaction(SIGPIPE, &sa, NULL)) < 0) {
PERROR("sigaction");
return ret;
if ((ret = sigaction(SIGPIPE, &sa, NULL)) < 0) {
PERROR("sigaction");
return ret;
@@
-314,6
+308,8
@@
int main(int argc, char **argv)
void *status;
struct lttng_consumer_local_data *tmp_ctx;
void *status;
struct lttng_consumer_local_data *tmp_ctx;
+ rcu_register_thread();
+
if (set_signal_handler()) {
retval = -1;
goto exit_set_signal_handler;
if (set_signal_handler()) {
retval = -1;
goto exit_set_signal_handler;
@@
-628,6
+624,12
@@
exit_init_data:
tmp_ctx = ctx;
ctx = NULL;
cmm_barrier(); /* Clear ctx for signal handler. */
tmp_ctx = ctx;
ctx = NULL;
cmm_barrier(); /* Clear ctx for signal handler. */
+ /*
+ * Wait for all pending call_rcu work to complete before tearing
+ * down data structures. call_rcu worker may be trying to
+ * perform lookups in those structures.
+ */
+ rcu_barrier();
lttng_consumer_destroy(tmp_ctx);
lttng_consumer_cleanup();
lttng_consumer_destroy(tmp_ctx);
lttng_consumer_cleanup();
@@
-643,6
+645,8
@@
exit_health_consumerd_cleanup:
exit_options:
exit_set_signal_handler:
exit_options:
exit_set_signal_handler:
+ rcu_unregister_thread();
+
if (!retval) {
exit(EXIT_SUCCESS);
} else {
if (!retval) {
exit(EXIT_SUCCESS);
} else {
This page took
0.023882 seconds
and
4
git commands to generate.