[client] Fix client status check (#4474)

The client status is not enough to protect the RPC calls from concurrency issues, because it is handled internally in the client in an asynchronous way.
This commit is contained in:
Zoltan Papp
2025-09-11 16:21:09 +02:00
committed by GitHub
parent 9e81e782e5
commit 47e64d72db
3 changed files with 213 additions and 203 deletions

View File

@@ -280,15 +280,12 @@ func (c *ConnectClient) run(mobileDependency MobileDependency, runningChan chan
return wrapErr(err)
}
log.Infof("Netbird engine started, the IP is: %s", peerConfig.GetAddress())
state.Set(StatusConnected)
if runningChan != nil {
select {
case runningChan <- struct{}{}:
default:
}
close(runningChan)
runningChan = nil
}
<-engineCtx.Done()