mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-03 04:19:18 +08:00
Fix connection timeout (#7203)
Signed-off-by: godchen <qingxiang.chen@zilliz.com>
This commit is contained in:
parent
be5c492e5a
commit
bf2c427609
@ -15,6 +15,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
|
||||
grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
|
||||
@ -90,7 +91,9 @@ 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,
|
||||
ctx, cancel := context.WithTimeout(c.ctx, 15*time.Second)
|
||||
defer cancel()
|
||||
conn, err := grpc.DialContext(ctx, c.addr,
|
||||
grpc.WithInsecure(), grpc.WithBlock(),
|
||||
grpc.WithDefaultCallOptions(
|
||||
grpc.MaxCallRecvMsgSize(Params.ClientMaxRecvSize),
|
||||
|
@ -15,6 +15,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/milvus-io/milvus/internal/log"
|
||||
"github.com/milvus-io/milvus/internal/util/retry"
|
||||
@ -68,7 +69,9 @@ func (c *Client) connect(retryOptions ...retry.Option) error {
|
||||
connectGrpcFunc := func() error {
|
||||
opts := trace.GetInterceptorOpts()
|
||||
log.Debug("DataNode connect ", zap.String("address", c.addr))
|
||||
conn, err := grpc.DialContext(c.ctx, c.addr,
|
||||
ctx, cancel := context.WithTimeout(c.ctx, 15*time.Second)
|
||||
defer cancel()
|
||||
conn, err := grpc.DialContext(ctx, c.addr,
|
||||
grpc.WithInsecure(), grpc.WithBlock(),
|
||||
grpc.WithDefaultCallOptions(
|
||||
grpc.MaxCallRecvMsgSize(Params.ClientMaxRecvSize),
|
||||
|
@ -15,6 +15,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
|
||||
@ -91,7 +92,9 @@ 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,
|
||||
ctx, cancel := context.WithTimeout(c.ctx, 15*time.Second)
|
||||
defer cancel()
|
||||
conn, err := grpc.DialContext(ctx, c.addr,
|
||||
grpc.WithInsecure(), grpc.WithBlock(),
|
||||
grpc.WithDefaultCallOptions(
|
||||
grpc.MaxCallRecvMsgSize(Params.ClientMaxRecvSize),
|
||||
|
@ -15,6 +15,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
|
||||
grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
|
||||
@ -64,7 +65,9 @@ func (c *Client) connect(retryOptions ...retry.Option) error {
|
||||
connectGrpcFunc := func() error {
|
||||
opts := trace.GetInterceptorOpts()
|
||||
log.Debug("IndexNodeClient try connect ", zap.String("address", c.addr))
|
||||
conn, err := grpc.DialContext(c.ctx, c.addr,
|
||||
ctx, cancel := context.WithTimeout(c.ctx, 15*time.Second)
|
||||
defer cancel()
|
||||
conn, err := grpc.DialContext(ctx, c.addr,
|
||||
grpc.WithInsecure(), grpc.WithBlock(),
|
||||
grpc.WithDefaultCallOptions(
|
||||
grpc.MaxCallRecvMsgSize(Params.ClientMaxRecvSize),
|
||||
|
@ -15,6 +15,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
|
||||
grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
|
||||
@ -63,7 +64,9 @@ func (c *Client) connect(retryOptions ...retry.Option) error {
|
||||
connectGrpcFunc := func() error {
|
||||
opts := trace.GetInterceptorOpts()
|
||||
log.Debug("ProxyClient try connect ", zap.String("address", c.addr))
|
||||
conn, err := grpc.DialContext(c.ctx, c.addr,
|
||||
ctx, cancel := context.WithTimeout(c.ctx, 15*time.Second)
|
||||
defer cancel()
|
||||
conn, err := grpc.DialContext(ctx, c.addr,
|
||||
grpc.WithInsecure(), grpc.WithBlock(),
|
||||
grpc.WithDefaultCallOptions(
|
||||
grpc.MaxCallRecvMsgSize(Params.ClientMaxRecvSize),
|
||||
|
@ -15,6 +15,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
|
||||
grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
|
||||
@ -91,7 +92,9 @@ 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,
|
||||
ctx, cancel := context.WithTimeout(c.ctx, 15*time.Second)
|
||||
defer cancel()
|
||||
conn, err := grpc.DialContext(ctx, c.addr,
|
||||
grpc.WithInsecure(), grpc.WithBlock(),
|
||||
grpc.WithDefaultCallOptions(
|
||||
grpc.MaxCallRecvMsgSize(Params.ClientMaxRecvSize),
|
||||
|
@ -15,6 +15,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
|
||||
@ -64,7 +65,9 @@ func (c *Client) connect(retryOptions ...retry.Option) error {
|
||||
connectGrpcFunc := func() error {
|
||||
opts := trace.GetInterceptorOpts()
|
||||
log.Debug("QueryNodeClient try connect ", zap.String("address", c.addr))
|
||||
conn, err := grpc.DialContext(c.ctx, c.addr,
|
||||
ctx, cancel := context.WithTimeout(c.ctx, 15*time.Second)
|
||||
defer cancel()
|
||||
conn, err := grpc.DialContext(ctx, c.addr,
|
||||
grpc.WithInsecure(), grpc.WithBlock(),
|
||||
grpc.WithDefaultCallOptions(
|
||||
grpc.MaxCallRecvMsgSize(Params.ClientMaxRecvSize),
|
||||
|
@ -15,6 +15,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
|
||||
grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
|
||||
@ -99,7 +100,9 @@ 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,
|
||||
ctx, cancel := context.WithTimeout(c.ctx, 15*time.Second)
|
||||
defer cancel()
|
||||
conn, err := grpc.DialContext(ctx, c.addr,
|
||||
grpc.WithInsecure(), grpc.WithBlock(),
|
||||
grpc.WithDefaultCallOptions(
|
||||
grpc.MaxCallRecvMsgSize(Params.ClientMaxRecvSize),
|
||||
|
Loading…
Reference in New Issue
Block a user