[client] Fix race conditions (#2869)

* Fix concurrent map access in status

* Fix race when retrieving ctx state error

* Fix race when accessing service controller server instance
This commit is contained in:
Viktor Liu
2024-11-11 14:55:10 +01:00
committed by GitHub
parent 30f025e7dd
commit e0bed2b0fb
4 changed files with 13 additions and 6 deletions

View File

@@ -207,7 +207,8 @@ func (c *ConnectClient) run(mobileDependency MobileDependency, probes *ProbeHold
c.statusRecorder.MarkSignalDisconnected(nil)
defer func() {
c.statusRecorder.MarkSignalDisconnected(state.err)
_, err := state.Status()
c.statusRecorder.MarkSignalDisconnected(err)
}()
// with the global Wiretrustee config in hand connect (just a connection, no stream yet) Signal