diff --git a/lxd/cluster/notify.go b/lxd/cluster/notify.go index 06d419f5ff0b..8f337292694b 100644 --- a/lxd/cluster/notify.go +++ b/lxd/cluster/notify.go @@ -3,6 +3,7 @@ package cluster import ( "context" "fmt" + "net/http" "sync" "time" @@ -10,6 +11,7 @@ import ( "github.com/canonical/lxd/lxd/db" "github.com/canonical/lxd/lxd/state" "github.com/canonical/lxd/shared" + "github.com/canonical/lxd/shared/api" "github.com/canonical/lxd/shared/logger" ) @@ -109,7 +111,9 @@ func NewNotifier(state *state.State, networkCert *shared.CertInfo, serverCert *s // TODO: aggregate all errors? for i, err := range errs { if err != nil { - if shared.IsConnectionError(err) && policy == NotifyAlive { + isDown := shared.IsConnectionError(err) || api.StatusErrorCheck(err, http.StatusServiceUnavailable) + + if isDown && policy == NotifyAlive { logger.Warnf("Could not notify node %s", peers[i]) continue }