Delete a reminder if the corresponding healthcheck is blacklisted #201
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.
Solves #198.
Problem
Currently, if the health check is blacklisted and it fails, there is no alert or reminder created. If the health check fails and then it is blacklisted, there can exist a reminder that will keep alerting.
Steps to reproduce:
Consul-alerts config:
consul-alerts/config/notif-profiles/log_with_reminders
:consul-alerts/config/notif-selection/hosts/Aleksandrs-MacBook-Pro.local
:To create a reminder I blocked the port 4646. On OS X I added the following line to the file
/private/etc/pf.conf
:Then reloaded the configuration:
Then started Consul-alerts and enabled
pf
:At this stage
Nomad Server HTTP Check
andNomad Client HTTP Check
were in the critical state, consul-alerts wrote notification messages to the log file and created reminders (expected behavior).Then I blacklisted the node by creating
consul-alerts/config/checks/blacklist/nodes/Aleksandrs-MacBook-Pro.local
key in Consul. The reminders kept writing alert messages in the log file.Solution
Delete blacklisted reminders if the corresponding health check is blacklisted. The appropriate place is in
CheckProcessor.reminderRun
because this is the only place that regularly check reminders, renews them and queues them for notification.@fusiondog Can you please review?