- The notifier was never checking if it should shutdown if there were always at least one notification to send
- After a failure, the notifier is supposed to back-off, but when Clair is stopping, the backoff was interrupted immediately and did not retry. Instead it selected a new notification to send (most likely: the same one) and looped quickly/weirdly.
log.Warningf("could not get content of notification '%s': %s",notification.GetName(),err)
returnfalse
returnfalse,false
}
// Create notification.
@ -185,14 +190,14 @@ func handleTask(notification database.Notification, st *utils.Stopper, maxAttemp
// Max attempts exceeded.
ifattempts>=maxAttempts{
log.Infof("giving up on sending notification '%s' to notifier '%s': max attempts exceeded (%d)\n",notification.GetName(),notifierName,maxAttempts)
returnfalse
returnfalse,false
}
// Backoff.
ifbackOff>0{
log.Infof("waiting %v before retrying to send notification '%s' to notifier '%s' (Attempt %d / %d)\n",backOff,notification.GetName(),notifierName,attempts+1,maxAttempts)
if!st.Sleep(backOff){
returnfalse
returnfalse,true
}
}
@ -210,7 +215,7 @@ func handleTask(notification database.Notification, st *utils.Stopper, maxAttemp
}
log.Infof("successfully sent notification '%s'\n",notification.GetName())
returntrue
returntrue,false
}
// Healthcheck returns the health of the notifier service.