refine retry on grpc (#26360)

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
pull/26401/head
wei liu 2023-08-16 19:36:18 +08:00 committed by GitHub
parent f9341f6640
commit 74133a3996
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -419,7 +419,7 @@ grpc:
keepAliveTimeout: 20000
maxMaxAttempts: 5
initialBackoff: 1
maxBackoff: 60
maxBackoff: 10
backoffMultiplier: 2
clientMaxSendSize: 268435456
clientMaxRecvSize: 268435456

View File

@ -222,8 +222,8 @@ func (c *ClientBase[T]) connect(ctx context.Context) error {
MinConnectTimeout: c.DialTimeout,
}),
grpc.WithPerRPCCredentials(&Token{Value: crypto.Base64Encode(util.MemberCredID)}),
grpc.WithDisableRetry(),
grpc.FailOnNonTempDialError(true),
grpc.WithReturnConnectionError(),
)
} else {
conn, err = grpc.DialContext(
@ -260,8 +260,8 @@ func (c *ClientBase[T]) connect(ctx context.Context) error {
MinConnectTimeout: c.DialTimeout,
}),
grpc.WithPerRPCCredentials(&Token{Value: crypto.Base64Encode(util.MemberCredID)}),
grpc.WithDisableRetry(),
grpc.FailOnNonTempDialError(true),
grpc.WithReturnConnectionError(),
)
}

View File

@ -45,7 +45,7 @@ const (
// Grpc retry policy
DefaultMaxAttempts = 5
DefaultInitialBackoff float64 = 1.0
DefaultMaxBackoff float64 = 60.0
DefaultMaxBackoff float64 = 10.0
DefaultBackoffMultiplier float64 = 2.0
DefaultCompressionEnabled bool = false