Skip to content

fix(cli): retry dial timeouts in SSH connection setup - #24199

Merged
EhabY merged 1 commit into
mainfrom
fix/retry-dial-timeout
Apr 9, 2026
Merged

EhabY merged 1 commit into
mainfrom
fix/retry-dial-timeout

Conversation

@EhabY

@EhabY EhabY commented Apr 9, 2026 •

Copy link
Copy Markdown
Collaborator

net.Dialer.Timeout expiry produces *net.OpError wrapping context.DeadlineExceeded. In isRetryableError, the DeadlineExceeded check fired before IsConnectionError, so dial timeouts were never retried.

This caused Coder Connect dial failures (broken tunnel, valid DNS) to immediately fail despite the retry logic from #24010.

Fix: check IsConnectionError before context.DeadlineExceeded. Network errors are now retried even when they wrap a deadline error. context.Canceled stays non-retryable.

Fixes #24201. Depends on #24010.

@github-actions github-actions Bot added the community Pull Requests and issues created by the community. label Apr 9, 2026
@EhabY EhabY removed the community Pull Requests and issues created by the community. label Apr 9, 2026
@EhabY
EhabY force-pushed the fix/retry-dial-timeout branch from b8014ed to 70ada96 Compare April 9, 2026 13:37
`net.Dialer.Timeout` expiry produces a `*net.OpError` that matches
`context.DeadlineExceeded` via `errors.Is`. The `isRetryableError`
check for `context.DeadlineExceeded` fired before `IsConnectionError`,
causing dial timeouts to be classified as non-retryable. This meant
Coder Connect dial failures (e.g. broken tunnel with valid DNS) were
never retried.

Fix by checking `IsConnectionError` before `context.DeadlineExceeded`
so network errors are always retryable, even when they wrap a deadline
exceeded error internally.
@EhabY
EhabY force-pushed the fix/retry-dial-timeout branch from 70ada96 to 74ff7e6 Compare April 9, 2026 13:56
@EhabY
EhabY marked this pull request as ready for review April 9, 2026 14:07
@EhabY
EhabY merged commit 1d0653c into main Apr 9, 2026
35 checks passed
@EhabY
EhabY deleted the fix/retry-dial-timeout branch April 9, 2026 21:55
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: dial timeouts from net.Dialer.Timeout are not retried in coder ssh

3 participants