Skip to content

Commit

Permalink
rebase main
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <ben.ye@bytedance.com>
  • Loading branch information
Ben Ye committed Jul 30, 2022
1 parent a732421 commit f897724
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions pkg/query/endpointset.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ type EndpointSet struct {

// Endpoint specifications can change dynamically. If some component is missing from the list, we assume it is no longer
// accessible and we close gRPC client for it, unless it is strict.
endpointSpec func() []*GRPCEndpointSpec
dialOpts []grpc.DialOption
endpointInfoTimeout time.Duration
endpointSpec func() map[string]*GRPCEndpointSpec
dialOpts []grpc.DialOption
endpointInfoTimeout time.Duration
unhealthyEndpointTimeout time.Duration

updateMtx sync.Mutex
Expand Down Expand Up @@ -293,16 +293,8 @@ func NewEndpointSet(
endpointsMetric: endpointsMetric,

dialOpts: dialOpts,
<<<<<<< HEAD
gRPCInfoCallTimeout: 5 * time.Second,
=======
endpointsMetric: endpointsMetric,
endpointInfoTimeout: endpointInfoTimeout,
endpoints: make(map[string]*endpointRef),
endpointStatuses: make(map[string]*EndpointStatus),
>>>>>>> 899a0020 (Expose Endpoint Info timeout parameter)
unhealthyEndpointTimeout: unhealthyEndpointTimeout,

endpointSpec: func() map[string]*GRPCEndpointSpec {
specs := make(map[string]*GRPCEndpointSpec)
for _, s := range endpointSpecs() {
Expand Down Expand Up @@ -335,7 +327,7 @@ func (e *EndpointSet) Update(ctx context.Context) {
wg.Add(1)
go func(spec *GRPCEndpointSpec) {
defer wg.Done()
ctx, cancel := context.WithTimeout(ctx, e.gRPCInfoCallTimeout)
ctx, cancel := context.WithTimeout(ctx, e.endpointInfoTimeout)
defer cancel()
e.updateEndpoint(ctx, spec, er)

Expand All @@ -350,7 +342,7 @@ func (e *EndpointSet) Update(ctx context.Context) {
wg.Add(1)
go func(spec *GRPCEndpointSpec) {
defer wg.Done()
ctx, cancel := context.WithTimeout(ctx, e.gRPCInfoCallTimeout)
ctx, cancel := context.WithTimeout(ctx, e.endpointInfoTimeout)
defer cancel()

newRef, err := e.newEndpointRef(ctx, spec)
Expand Down

0 comments on commit f897724

Please sign in to comment.