After we fix #3786
I think that we haven't finished with this bug yet. I've updated lib version, decided to re-check and noticed that dial tcp timeouts still not redirectable. So I think that problem is here
# internal/pool/pool.go
attemptCtx, cancel = context.WithTimeout(ctx, p.cfg.DialTimeout)
We use context timeout here. So when dial timeout is over *net.OpError{Op: "dial"} is wrapped inside ContextDeadlineExceeded, so in shouldRetry this condition is true
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
return false
}
I suppose that we should move new condition before this check
var opErr *net.OpError
if errors.As(err, &opErr) && opErr.Op == "dial" {
return true
}
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
return false
}
@ndyakov Hi! I commented in original issue #3799 (comment) so we can reopen it or discuss it here
After we fix #3786
I think that we haven't finished with this bug yet. I've updated lib version, decided to re-check and noticed that dial tcp timeouts still not redirectable. So I think that problem is here
We use context timeout here. So when dial timeout is over *net.OpError{Op: "dial"} is wrapped inside ContextDeadlineExceeded, so in shouldRetry this condition is true
I suppose that we should move new condition before this check
@ndyakov Hi! I commented in original issue #3799 (comment) so we can reopen it or discuss it here