Fix [#873]: Don't notify if parents down #995
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A few things here. I noticed that a lot of logic for handling whether a recovery notification was sent used the assumption that the service_notification command always sends a notification (it doesn't) so I moved the resetting of notified_on and the notification number into the notification commands
I also wanted the notification command to differentiate between normal and recovery notifications so I also added that functionality.
This was all so that I could accurately handle sending of recovery notifications so I can suppress any notifications if the parents is found to be down. Debating whether or not I should make this behavior dependent on a flag that is set.
I also added a test notification file to test the notification viability commands. Ideally, we would be able to use both the logic in the async handler functions and the notification viability testing together but there are some issues that need to get dealt with first to make that a reality.
I also noticed that e7a17b3 introduced a bug by switching the logic for when a parent host check is propagated upwards. I fixed that as well