From 65a4320c7539f4915e799f652475c739b7ad58b7 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Wed, 23 Oct 2024 14:04:37 +0300 Subject: [PATCH] [#1441] services/tree: Use `grpc.WaitForReady` option when creating client Signed-off-by: Aleksey Savchuk --- pkg/services/tree/cache.go | 1 + pkg/services/tree/sync.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/services/tree/cache.go b/pkg/services/tree/cache.go index e490cb855..ac80d0e4c 100644 --- a/pkg/services/tree/cache.go +++ b/pkg/services/tree/cache.go @@ -103,6 +103,7 @@ func (c *clientCache) dialTreeService(ctx context.Context, netmapAddr string) (* tracing.NewStreamClientInterceptor(), ), grpc.WithContextDialer(c.ds.GrpcContextDialer()), + grpc.WithDefaultCallOptions(grpc.WaitForReady(true)), } if !netAddr.IsTLSEnabled() { diff --git a/pkg/services/tree/sync.go b/pkg/services/tree/sync.go index 5bbc93978..ce1e72104 100644 --- a/pkg/services/tree/sync.go +++ b/pkg/services/tree/sync.go @@ -342,7 +342,9 @@ func (*Service) createConnection(a network.Address) (*grpc.ClientConn, error) { metrics.NewStreamClientInterceptor(), tracing_grpc.NewStreamClientInterceptor(), ), - grpc.WithTransportCredentials(insecure.NewCredentials())) + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithDefaultCallOptions(grpc.WaitForReady(true)), + ) } // ErrAlreadySyncing is returned when a service synchronization has already