Retry transport creation when ClientHandshake returns EOF
ClientHandshake performs the first IO on the connection and can give us the first indication that the connection was closed. Making any error from ClientHandshake a non-temporary error causes grpc.Invoke to not retry a non-failfast RPC. See https://github.com/cockroachdb/cockroach/issues/8353.
This commit is contained in:
@ -129,8 +129,9 @@ func newHTTP2Client(ctx context.Context, addr string, opts ConnectOptions) (_ Cl
|
|||||||
conn, authInfo, connErr = creds.ClientHandshake(ctx, addr, conn)
|
conn, authInfo, connErr = creds.ClientHandshake(ctx, addr, conn)
|
||||||
}
|
}
|
||||||
if connErr != nil {
|
if connErr != nil {
|
||||||
// Credentials handshake error is not a temporary error.
|
// Credentials handshake error is not a temporary error (unless the error
|
||||||
return nil, ConnectionErrorf(false, connErr, "transport: %v", connErr)
|
// was the connection closing).
|
||||||
|
return nil, ConnectionErrorf(connErr == io.EOF, connErr, "transport: %v", connErr)
|
||||||
}
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user