Change client init timeout (#6107)

Signed-off-by: godchen <qingxiang.chen@zilliz.com>
pull/6112/head
godchen 2021-06-25 15:50:23 +08:00 committed by GitHub
parent 34d0a04139
commit 73996aba91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 16 additions and 16 deletions

View File

@ -75,7 +75,7 @@ func NewClient(ctx context.Context, metaRoot string, etcdEndpoints []string) (*C
}
func (c *Client) Init() error {
return c.connect(retry.Attempts(300))
return c.connect(retry.Attempts(20))
}
func (c *Client) connect(retryOptions ...retry.Option) error {
@ -89,7 +89,7 @@ func (c *Client) connect(retryOptions ...retry.Option) error {
opts := trace.GetInterceptorOpts()
log.Debug("DataCoordClient try reconnect ", zap.String("address", c.addr))
conn, err := grpc.DialContext(c.ctx, c.addr,
grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(3*time.Second),
grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(2*time.Second),
grpc.WithUnaryInterceptor(
grpc_middleware.ChainUnaryClient(
grpc_retry.UnaryClientInterceptor(),

View File

@ -59,7 +59,7 @@ func NewClient(ctx context.Context, addr string, retryOptions ...retry.Option) (
}
func (c *Client) Init() error {
return c.connect(retry.Attempts(300))
return c.connect(retry.Attempts(20))
}
func (c *Client) connect(retryOptions ...retry.Option) error {
@ -67,7 +67,7 @@ func (c *Client) connect(retryOptions ...retry.Option) error {
opts := trace.GetInterceptorOpts()
log.Debug("DataNode connect ", zap.String("address", c.addr))
conn, err := grpc.DialContext(c.ctx, c.addr,
grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(5*time.Second),
grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(2*time.Second),
grpc.WithUnaryInterceptor(
grpc_middleware.ChainUnaryClient(
grpc_retry.UnaryClientInterceptor(),

View File

@ -77,7 +77,7 @@ func NewClient(ctx context.Context, metaRoot string, etcdEndpoints []string) (*C
}
func (c *Client) Init() error {
return c.connect(retry.Attempts(300))
return c.connect(retry.Attempts(20))
}
func (c *Client) connect(retryOptions ...retry.Option) error {
@ -91,7 +91,7 @@ func (c *Client) connect(retryOptions ...retry.Option) error {
opts := trace.GetInterceptorOpts()
log.Debug("IndexCoordClient try connect ", zap.String("address", c.addr))
conn, err := grpc.DialContext(c.ctx, c.addr,
grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(3*time.Second),
grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(2*time.Second),
grpc.WithUnaryInterceptor(
grpc_middleware.ChainUnaryClient(
grpc_retry.UnaryClientInterceptor(),

View File

@ -55,7 +55,7 @@ func NewClient(ctx context.Context, addr string) (*Client, error) {
}
func (c *Client) Init() error {
return c.connect(retry.Attempts(300))
return c.connect(retry.Attempts(20))
}
func (c *Client) connect(retryOptions ...retry.Option) error {
@ -63,7 +63,7 @@ func (c *Client) connect(retryOptions ...retry.Option) error {
opts := trace.GetInterceptorOpts()
log.Debug("IndexNodeClient try connect ", zap.String("address", c.addr))
conn, err := grpc.DialContext(c.ctx, c.addr,
grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(5*time.Second),
grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(2*time.Second),
grpc.WithUnaryInterceptor(
grpc_middleware.ChainUnaryClient(
grpc_retry.UnaryClientInterceptor(),

View File

@ -54,7 +54,7 @@ func NewClient(ctx context.Context, addr string) (*Client, error) {
}
func (c *Client) Init() error {
return c.connect(retry.Attempts(300))
return c.connect(retry.Attempts(20))
}
func (c *Client) connect(retryOptions ...retry.Option) error {
@ -62,7 +62,7 @@ func (c *Client) connect(retryOptions ...retry.Option) error {
opts := trace.GetInterceptorOpts()
log.Debug("ProxyClient try connect ", zap.String("address", c.addr))
conn, err := grpc.DialContext(c.ctx, c.addr,
grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(5*time.Second),
grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(2*time.Second),
grpc.WithUnaryInterceptor(
grpc_middleware.ChainUnaryClient(
grpc_retry.UnaryClientInterceptor(),

View File

@ -76,7 +76,7 @@ func NewClient(ctx context.Context, metaRoot string, etcdEndpoints []string) (*C
}
func (c *Client) Init() error {
return c.connect(retry.Attempts(300))
return c.connect(retry.Attempts(20))
}
func (c *Client) connect(retryOptions ...retry.Option) error {
@ -90,7 +90,7 @@ func (c *Client) connect(retryOptions ...retry.Option) error {
opts := trace.GetInterceptorOpts()
log.Debug("QueryCoordClient try reconnect ", zap.String("address", c.addr))
conn, err := grpc.DialContext(c.ctx, c.addr,
grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(5*time.Second),
grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(2*time.Second),
grpc.WithUnaryInterceptor(
grpc_middleware.ChainUnaryClient(
grpc_retry.UnaryClientInterceptor(),

View File

@ -55,7 +55,7 @@ func NewClient(ctx context.Context, addr string) (*Client, error) {
}
func (c *Client) Init() error {
return c.connect(retry.Attempts(300))
return c.connect(retry.Attempts(20))
}
func (c *Client) connect(retryOptions ...retry.Option) error {
@ -63,7 +63,7 @@ func (c *Client) connect(retryOptions ...retry.Option) error {
opts := trace.GetInterceptorOpts()
log.Debug("QueryNodeClient try connect ", zap.String("address", c.addr))
conn, err := grpc.DialContext(c.ctx, c.addr,
grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(5*time.Second),
grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(2*time.Second),
grpc.WithUnaryInterceptor(
grpc_middleware.ChainUnaryClient(
grpc_retry.UnaryClientInterceptor(),

View File

@ -83,7 +83,7 @@ func NewClient(ctx context.Context, metaRoot string, etcdEndpoints []string) (*G
}
func (c *GrpcClient) Init() error {
return c.connect(retry.Attempts(300))
return c.connect(retry.Attempts(20))
}
func (c *GrpcClient) connect(retryOptions ...retry.Option) error {
@ -97,7 +97,7 @@ func (c *GrpcClient) connect(retryOptions ...retry.Option) error {
opts := trace.GetInterceptorOpts()
log.Debug("RootCoordClient try reconnect ", zap.String("address", c.addr))
conn, err := grpc.DialContext(c.ctx, c.addr,
grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(5*time.Second),
grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(2*time.Second),
grpc.WithUnaryInterceptor(
grpc_middleware.ChainUnaryClient(
grpc_retry.UnaryClientInterceptor(),