Skip to content

Commit

Permalink
fix potential deadlock in dynconfig resolver (#3024)
Browse files Browse the repository at this point in the history
  • Loading branch information
realityone authored Jan 16, 2024
1 parent a34816f commit 9a1c744
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/rpc/cdnsystem/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func GetClientByAddr(ctx context.Context, netAddr dfnet.NetAddr, opts ...grpc.Di
ctx,
netAddr.Addr,
append([]grpc.DialOption{
grpc.WithIdleTimeout(0),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient(
rpc.ConvertErrorUnaryClientInterceptor,
Expand Down Expand Up @@ -95,6 +96,7 @@ func GetClient(ctx context.Context, dynconfig config.DynconfigInterface, opts ..
ctx,
resolver.SeedPeerVirtualTarget,
append([]grpc.DialOption{
grpc.WithIdleTimeout(0),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
grpc.WithDefaultServiceConfig(pkgbalancer.BalancerServiceConfig),
grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient(
Expand Down
1 change: 1 addition & 0 deletions pkg/rpc/dfdaemon/client/client_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func GetV1(ctx context.Context, target string, opts ...grpc.DialOption) (V1, err
ctx,
target,
append([]grpc.DialOption{
grpc.WithIdleTimeout(0),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient(
rpc.ConvertErrorUnaryClientInterceptor,
Expand Down
1 change: 1 addition & 0 deletions pkg/rpc/dfdaemon/client/client_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func GetV2(ctx context.Context, dynconfig config.DynconfigInterface, opts ...grp
ctx,
resolver.SeedPeerVirtualTarget,
append([]grpc.DialOption{
grpc.WithIdleTimeout(0),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
grpc.WithDefaultServiceConfig(pkgbalancer.BalancerServiceConfig),
grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient(
Expand Down
1 change: 1 addition & 0 deletions pkg/rpc/health/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func GetClient(ctx context.Context, target string, opts ...grpc.DialOption) (Cli
ctx,
target,
append([]grpc.DialOption{
grpc.WithIdleTimeout(0),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient(
grpc_prometheus.UnaryClientInterceptor,
Expand Down
1 change: 1 addition & 0 deletions pkg/rpc/inference/client/client_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func GetV1(ctx context.Context, target string, opts ...grpc.DialOption) (V1, err
ctx,
target,
append([]grpc.DialOption{
grpc.WithIdleTimeout(0),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient(
grpc_prometheus.UnaryClientInterceptor,
Expand Down
1 change: 1 addition & 0 deletions pkg/rpc/manager/client/client_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func GetV1ByAddr(ctx context.Context, target string, opts ...grpc.DialOption) (V
ctx,
target,
append([]grpc.DialOption{
grpc.WithIdleTimeout(0),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient(
grpc_prometheus.UnaryClientInterceptor,
Expand Down
1 change: 1 addition & 0 deletions pkg/rpc/manager/client/client_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func GetV2ByAddr(ctx context.Context, target string, opts ...grpc.DialOption) (V
ctx,
target,
append([]grpc.DialOption{
grpc.WithIdleTimeout(0),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient(
grpc_prometheus.UnaryClientInterceptor,
Expand Down
2 changes: 2 additions & 0 deletions pkg/rpc/scheduler/client/client_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func GetV1(ctx context.Context, dynconfig config.Dynconfig, opts ...grpc.DialOpt
ctx,
resolver.SchedulerVirtualTarget,
append([]grpc.DialOption{
grpc.WithIdleTimeout(0),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
grpc.WithDefaultServiceConfig(pkgbalancer.BalancerServiceConfig),
grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient(
Expand Down Expand Up @@ -91,6 +92,7 @@ func GetV1ByAddr(ctx context.Context, target string, opts ...grpc.DialOption) (V
ctx,
target,
append([]grpc.DialOption{
grpc.WithIdleTimeout(0),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
grpc.WithDefaultServiceConfig(pkgbalancer.BalancerServiceConfig),
grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient(
Expand Down
2 changes: 2 additions & 0 deletions pkg/rpc/scheduler/client/client_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func GetV2(ctx context.Context, dynconfig config.Dynconfig, opts ...grpc.DialOpt
ctx,
resolver.SchedulerVirtualTarget,
append([]grpc.DialOption{
grpc.WithIdleTimeout(0),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
grpc.WithDefaultServiceConfig(pkgbalancer.BalancerServiceConfig),
grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient(
Expand Down Expand Up @@ -88,6 +89,7 @@ func GetV2ByAddr(ctx context.Context, target string, opts ...grpc.DialOption) (V
ctx,
target,
append([]grpc.DialOption{
grpc.WithIdleTimeout(0),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
grpc.WithDefaultServiceConfig(pkgbalancer.BalancerServiceConfig),
grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient(
Expand Down
1 change: 1 addition & 0 deletions pkg/rpc/security/client/client_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func GetV1(ctx context.Context, target string, opts ...grpc.DialOption) (V1, err
ctx,
target,
append([]grpc.DialOption{
grpc.WithIdleTimeout(0),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient(
grpc_prometheus.UnaryClientInterceptor,
Expand Down
1 change: 1 addition & 0 deletions pkg/rpc/trainer/client/client_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func GetV1ByAddr(ctx context.Context, target string, opts ...grpc.DialOption) (V
ctx,
target,
append([]grpc.DialOption{
grpc.WithIdleTimeout(0),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient(
grpc_prometheus.UnaryClientInterceptor,
Expand Down

0 comments on commit 9a1c744

Please sign in to comment.