fix peer update concurrency on the client side (#177)

* fix: gRpc Signal and Management connections deadlock on IDLE state

* fix: client peer update concurrency issues
This commit is contained in:
Mikhail Bragin
2021-12-31 18:11:33 +01:00
committed by GitHub
parent 6ae27c9a9b
commit a67b9a16af
3 changed files with 33 additions and 22 deletions

View File

@ -207,7 +207,7 @@ func (c *Client) connect(key string) (proto.SignalExchange_ConnectStreamClient,
// ready indicates whether the client is okay and ready to be used
// for now it just checks whether gRPC connection to the service is in state Ready
func (c *Client) ready() bool {
return c.signalConn.GetState() == connectivity.Ready
return c.signalConn.GetState() == connectivity.Ready || c.signalConn.GetState() == connectivity.Idle
}
// WaitStreamConnected waits until the client is connected to the Signal stream