Alerting: Remove the fixed wait for notification delivery (#37203)

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
This commit is contained in:
Ganesh Vernekar 2021-07-26 18:45:09 +05:30 committed by GitHub
parent 59c691a777
commit a65975cca0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -661,7 +661,12 @@ func (am *Alertmanager) createReceiverStage(name string, integrations []notify.I
}
func waitFunc() time.Duration {
return setting.AlertingNotificationTimeout
// When it's a single instance, we don't need additional wait. The routing policies will have their own group wait.
// We need >0 wait here in case we have peers to sync the notification state with. 0 wait in that case can result
// in duplicate notifications being sent.
// TODO: we have setting.AlertingNotificationTimeout in legacy settings. Either use that or separate set of config
// for clustering with intuitive name, like "PeerTimeout".
return 0
}
func timeoutFunc(d time.Duration) time.Duration {