context.DeadlineExceeded returned by ClientHandshake should not be fatal error
This commit is contained in:
@ -136,8 +136,13 @@ func newHTTP2Client(ctx context.Context, addr string, opts ConnectOptions) (_ Cl
|
|||||||
}
|
}
|
||||||
if connErr != nil {
|
if connErr != nil {
|
||||||
// Credentials handshake error is not a temporary error (unless the error
|
// Credentials handshake error is not a temporary error (unless the error
|
||||||
// was the connection closing).
|
// was the connection closing or deadline exceeded).
|
||||||
return nil, ConnectionErrorf(connErr == io.EOF, connErr, "transport: %v", connErr)
|
var temp bool
|
||||||
|
switch connErr {
|
||||||
|
case io.EOF, context.DeadlineExceeded:
|
||||||
|
temp = true
|
||||||
|
}
|
||||||
|
return nil, ConnectionErrorf(temp, connErr, "transport: %v", connErr)
|
||||||
}
|
}
|
||||||
ua := primaryUA
|
ua := primaryUA
|
||||||
if opts.UserAgent != "" {
|
if opts.UserAgent != "" {
|
||||||
|
Reference in New Issue
Block a user