diff --git a/agent/local/state.go b/agent/local/state.go index b279f3b1d..b54037d50 100644 --- a/agent/local/state.go +++ b/agent/local/state.go @@ -1175,6 +1175,9 @@ func (l *State) SyncChanges() error { defer l.Unlock() // Sync the node level info if we need to. + // At the start to guarantee sync even if services or checks fail, + // which is more likely because there are more syncs happening for them. + if l.nodeInfoInSync { l.logger.Debug("Node info in sync") } else { @@ -1183,10 +1186,6 @@ func (l *State) SyncChanges() error { } } - // We will do node-level info syncing at the end, since it will get - // updated by a service or check sync anyway, given how the register - // API works. - // Sync the services // (logging happens in the helper methods) for id, s := range l.services {