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

@ -83,7 +83,7 @@ func defaultBackoff(ctx context.Context) backoff.BackOff {
// ready indicates whether the client is okay and ready to be used
// for now it just checks whether gRPC connection to the service is ready
func (c *Client) ready() bool {
return c.conn.GetState() == connectivity.Ready
return c.conn.GetState() == connectivity.Ready || c.conn.GetState() == connectivity.Idle
}
// Sync wraps the real client's Sync endpoint call and takes care of retries and encryption/decryption of messages