Closed mastercactapus closed 6 months ago
It might be helpful to emit an error upon hitting the missing log entry case (as it shouldn't happen) as long as it's in a way that the error will only be logged once.
Start of fix: https://github.com/target/goalert/tree/fix-status-missing-log
Describe the Bug: If an alert's status is updated, without a corresponding entry in the
alert_logs
table for any reason, the status manager gets stuck with errors, potentially blocking status updates for other alerts, and the alert in question never has things like Slack messages update.Steps to Reproduce: Since it's an edge case, the exact steps are uncertain. But it follows this pattern:
Expected Behavior: On failure to record a log, an error should be logged, but status updates should continue to work even in the absence of a specific alert's log.
Observed Behavior: Status updates break entirely because they stay "stuck" on the error-state alert.
Screenshots/Stack Traces:
Application Version: Discovered on GoAlert with GitCommit 5e8ce484c02987983668fbeeb4a11431f4e85389.
Desktop: Not applicable as it is a backend/engine issue.
Additional Context Fix notes:
alert_log_id
column in this casesendmessage.go
to skip fetching the log if it's zero and use an empty string (also if the log lookup returns ErrNoRows)