From 94a47f0f04f5e3d9f9a4aa884d84678d63c72eb1 Mon Sep 17 00:00:00 2001 From: Mikael Beckius Date: Thu, 23 Jan 2025 10:10:01 +0100 Subject: [PATCH] Fix: consumerd: swap live and monitor signal priorities Live signal handling may block montior signal handling in situations when there is high network latency. Signed-off-by: Mikael Beckius --- src/common/consumer/consumer-timer.h | 4 ++-- src/common/consumer/consumer.c | 6 +++--- src/common/ust-consumer/ust-consumer.c | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/common/consumer/consumer-timer.h b/src/common/consumer/consumer-timer.h index bf1649cad..f28c41acd 100644 --- a/src/common/consumer/consumer-timer.h +++ b/src/common/consumer/consumer-timer.h @@ -16,8 +16,8 @@ #define LTTNG_CONSUMER_SIG_SWITCH SIGRTMIN + 10 #define LTTNG_CONSUMER_SIG_TEARDOWN SIGRTMIN + 11 -#define LTTNG_CONSUMER_SIG_LIVE SIGRTMIN + 12 -#define LTTNG_CONSUMER_SIG_MONITOR SIGRTMIN + 13 +#define LTTNG_CONSUMER_SIG_MONITOR SIGRTMIN + 12 +#define LTTNG_CONSUMER_SIG_LIVE SIGRTMIN + 13 #define LTTNG_CONSUMER_SIG_EXIT SIGRTMIN + 14 #define CLOCKID CLOCK_MONOTONIC diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index ff88c7f1e..c7d49293b 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -371,12 +371,12 @@ void consumer_del_channel(struct lttng_consumer_channel *channel) /* Destroy streams that might have been left in the stream list. */ clean_channel_stream_list(channel); - if (channel->live_timer_enabled == 1) { - consumer_timer_live_stop(channel); - } if (channel->monitor_timer_enabled == 1) { consumer_timer_monitor_stop(channel); } + if (channel->live_timer_enabled == 1) { + consumer_timer_live_stop(channel); + } switch (the_consumer_data.type) { case LTTNG_CONSUMER_KERNEL: diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index b43ae58ff..33bf30fbb 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -1628,12 +1628,12 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, } consumer_metadata_cache_destroy(channel); } - if (channel->live_timer_enabled == 1) { - consumer_timer_live_stop(channel); - } if (channel->monitor_timer_enabled == 1) { consumer_timer_monitor_stop(channel); } + if (channel->live_timer_enabled == 1) { + consumer_timer_live_stop(channel); + } goto end_channel_error; } -- 2.43.0