From 69b0711d12d94cf4cb07eb1de218c1955a3c66ad Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 5 Mar 2025 15:06:29 +0300 Subject: [PATCH] [#342] client: Disable service config query By default, gRPC fetches TXT report while resolving a domain. https://github.com/grpc/grpc-go/blob/0914bba6c5c5a545d34bd11e5dee0bbb8eaadd3f/internal/resolver/dns/dns_resolver.go#L336 This leads to a hanging dial if DNS is unavailable, even though the host may be specified in `/etc/hosts` (hello, localhost!). Use `grpc.WithDisableServiceConfig()` to override the default. This option seems impossible to override with `WithGRPCDialOpts()`, but we do not use service config anyway. Signed-off-by: Evgenii Stratonikov --- api/rpc/client/options.go | 1 + 1 file changed, 1 insertion(+) diff --git a/api/rpc/client/options.go b/api/rpc/client/options.go index 5711cd4d..df6f6ed8 100644 --- a/api/rpc/client/options.go +++ b/api/rpc/client/options.go @@ -38,6 +38,7 @@ func (c *cfg) initDefault() { c.rwTimeout = defaultRWTimeout c.grpcDialOpts = []grpc.DialOption{ grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithDisableServiceConfig(), } }