From 4627645442345dd5e433fec33913f034d48c8091 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 3 May 2023 14:12:26 +0200 Subject: [PATCH 1/2] manager: simplify manager_process_barrier_fd() a bit --- src/core/manager.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/manager.c b/src/core/manager.c index 9226cd2ab7..2a7e80ca67 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -2525,11 +2525,10 @@ static bool manager_process_barrier_fd(char * const *tags, FDSet *fds) { /* nothing else must be sent when using BARRIER=1 */ if (strv_contains(tags, "BARRIER=1")) { - if (strv_length(tags) == 1) { - if (fdset_size(fds) != 1) - log_warning("Got incorrect number of fds with BARRIER=1, closing them."); - } else + if (strv_length(tags) != 1) log_warning("Extra notification messages sent with BARRIER=1, ignoring everything."); + else if (fdset_size(fds) != 1) + log_warning("Got incorrect number of fds with BARRIER=1, closing them."); /* Drop the message if BARRIER=1 was found */ return true; From 7b0a12675106f7667254b67f3f759249cd47ea2c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 3 May 2023 14:12:43 +0200 Subject: [PATCH 2/2] manager: add debug logging about BARRIER=1 messages --- src/core/manager.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/manager.c b/src/core/manager.c index 2a7e80ca67..36881de479 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -2672,8 +2672,10 @@ static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t } /* Possibly a barrier fd, let's see. */ - if (manager_process_barrier_fd(tags, fds)) + if (manager_process_barrier_fd(tags, fds)) { + log_debug("Received barrier notification message from PID " PID_FMT ".", ucred->pid); return 0; + } /* Increase the generation counter used for filtering out duplicate unit invocations. */ m->notifygen++;