Skip to content

Commit 47e64d7

Browse files
authored
[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.
1 parent 9e81e78 commit 47e64d7

File tree

3 files changed

+213
-203
lines changed

3 files changed

+213
-203
lines changed

client/internal/connect.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,12 @@ func (c *ConnectClient) run(mobileDependency MobileDependency, runningChan chan
280280
return wrapErr(err)
281281
}
282282

283-
284283
log.Infof("Netbird engine started, the IP is: %s", peerConfig.GetAddress())
285284
state.Set(StatusConnected)
286285

287286
if runningChan != nil {
288-
select {
289-
case runningChan <- struct{}{}:
290-
default:
291-
}
287+
close(runningChan)
288+
runningChan = nil
292289
}
293290

294291
<-engineCtx.Done()

0 commit comments

Comments
 (0)