Fix error state race on mgmt connection error (#2892)

This commit is contained in:
Viktor Liu 2024-11-15 22:59:49 +01:00 committed by GitHub
parent 582bb58714
commit a7d5c52203
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -157,7 +157,8 @@ func (c *ConnectClient) run(mobileDependency MobileDependency, probes *ProbeHold
engineCtx, cancel := context.WithCancel(c.ctx)
defer func() {
c.statusRecorder.MarkManagementDisconnected(state.err)
_, err := state.Status()
c.statusRecorder.MarkManagementDisconnected(err)
c.statusRecorder.CleanLocalPeerState()
cancel()
}()