Skip to content

Conversation

@jschmidt-icinga
Copy link
Contributor

Problem

The race is between NotificationTimerHandler, which sends a reminder notification
after a certain inverval during problem states and SendNotificationsHandler which
sends out the notifications on state changes.

When the timer handler runs just before a state change triggers a notification, the
timer handler might pick up that state-change before the send notification handler
can set its no_more_notifications flag. In that case a "reminder" notification will
be sent out before the initial one, and despite interval = 0 on the notification
object.

Solution?

The trivial solution here is to never attempt to send a reminder if interval <= 0 and not wait for the no_more_notifications flag. I'm not entirely sure if there are any negative consequences to that because I don't understand what this flag is even supposed to do. It seems it only gets set in case of interval <= 0 and only ever used in this one place. I can think of many valid reasons to want to turn off reminders under certain conditions for a while, but this doesn't even do that, since it was an &&-condition, not an || (which it is in the current state of this PR).

Fixes #10623.

The race is between `NotificationTimerHandler`, which sends a reminder notification
after a certain inverval during problem states and `SendNotificationsHandler` which
sends out the notifications on state changes.

When the timer handler runs just before a state change triggers a notification, the
timer handler might pick up that state-change before the send notification handler
can set its no_more_notifications flag. In that case a "reminder" notification will
be sent out before the initial one, and despite `interval = 0` on the notification
object.
Fix the race condition described in the previous commit by not requiring
the no_more_notifications flag to skip reminders in case of `interval = 0`.
@cla-bot cla-bot bot added the cla/signed label Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate notifications

2 participants