grpc.WithConnectParams.Backoff 和 grpc_retry.WithBackoff 有什么区别?

What is the difference between grpc.WithConnectParams.Backoff and grpc_retry.WithBackoff?

我想了解两种 GRPC 重试方式之间的区别。

一个是grpc.WithConnectParams;也就是说,假设

grpc.Dial(address, grpc.WithConnectParams(grpc.ConnectParams{
    Backoff: backoff.Config{
        BaseDelay: 1 * time.Second,
        Multiplier: 1.6,
        MaxDelay: 15*time.Second,
    }))

grpc.Dial(address, []grpc_retry.CallOption{
    grpc_retry.WithMax(4),
    grpc_retry.WithBackoff(grpc_retry.BackoffExponential(1*time.Second)),
})

第一个记录在这里

https://pkg.go.dev/google.golang.org/grpc/backoff

另一个在此处记录

https://pkg.go.dev/github.com/grpc-ecosystem/go-grpc-middleware/retry

他们好像在做同样的事情...?我不太确定

grpc.WithConnectParams.Backoff 重试“低级别”——连接级别;而 grpc_retry.CallOption 会在请求级别重试。