mirror of https://github.com/milvus-io/milvus.git
Change client init timeout (#6107)
Signed-off-by: godchen <qingxiang.chen@zilliz.com>pull/6112/head
parent
34d0a04139
commit
73996aba91
|
@ -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(),
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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(),
|
||||
|
|
Loading…
Reference in New Issue