fix: resolve gRPC DNS resolution issues in Kubernetes #8384 (#8387)

* fix: resolve gRPC DNS resolution issues in Kubernetes #8384

- Replace direct `grpc.NewClient` calls with `pb.GrpcDial` for consistent connection establishment
- Fix async DNS resolution behavior in K8s with `ndots:5`
- Ensure high-level components use established helper for reliable networking

* refactor: refine gRPC DNS fix and add documentation

- Use instance's grpcDialOption in BrokerClient.ConfigureTopic
- Add detailed comments to GrpcDial explaining Kubernetes DNS resolution rationale

* fix: ensure proper context propagation in broker_client gRPC calls

- Pass the provided `ctx` to `pb.GrpcDial` in `ConfigureTopic` and `GetUnflushedMessages`
- Ensures that timeouts and cancellations are correctly honored during connection establishment

* docs: refine gRPC resolver documentation and cleanup dead code

- Enhanced documentation for `GrpcDial` with explicit warnings about global state mutation when using `resolver.SetDefaultScheme("passthrough")`.
- Recommended `passthrough:///` prefix as the primary migration path for `grpc.NewClient`.
- Removed dead commented-out code for `grpc.WithBlock()` and `grpc.WithTimeout()`.
This commit is contained in:
Chris Lu
2026-02-19 15:46:02 -08:00
committed by GitHub
parent e9c45144cf
commit a2005cb2a6
3 changed files with 18 additions and 10 deletions

View File

@@ -51,7 +51,7 @@ func (fds *FilerDiscoveryService) discoverFilersFromMaster(masterAddr pb.ServerA
// Convert HTTP master address to gRPC address (HTTP port + 10000)
grpcAddr := masterAddr.ToGrpcAddress()
conn, err := grpc.NewClient(grpcAddr, fds.grpcDialOption)
conn, err := pb.GrpcDial(context.Background(), grpcAddr, false, fds.grpcDialOption)
if err != nil {
return nil, fmt.Errorf("failed to connect to master at %s: %v", grpcAddr, err)
}