From 409ca5b425348ba7010543789700af06ae344249 Mon Sep 17 00:00:00 2001 From: John Wass Date: Tue, 26 Nov 2024 13:31:55 -0500 Subject: [PATCH] Revert change to report interval logic In 75acb36 the `else` block was changed to an `else if` at line 418. This caused the pthread_cond_wait to fall outside of the else condition, which let the decision thread block indefinitely when a report interval was enabled. The fix is to restore the else so that the untimed blocking pthread call is only made when reporting is not enabled. --- src/daemon/notify.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/daemon/notify.c b/src/daemon/notify.c index 5cb265ec..fa404718 100644 --- a/src/daemon/notify.c +++ b/src/daemon/notify.c @@ -414,14 +414,17 @@ static void *decision_thread_main(void *arg) pthread_cond_timedwait(&do_decision, &decision_lock, &rpt_timeout); - } else if (run_stats) { - rpt_write(); - run_stats = 0; + } else { + if (run_stats) { + rpt_write(); + run_stats = 0; + } + if (stop) + break; + + // no interval reports, await a fan event indefinitely + pthread_cond_wait(&do_decision, &decision_lock); } - // no interval reports, await a fan event indefinitely - if (stop) - break; - pthread_cond_wait(&do_decision, &decision_lock); } if (stop) {