Skip to content

[release-2.0] Make network transport errors retryable - #981

Merged
mandre merged 1 commit into
release-2.0from
bp-release-2.0-6ca3140
Oct 13, 2026
Merged

mandre merged 1 commit into
release-2.0from
bp-release-2.0-6ca3140

Conversation

@orc-backport-bot

Copy link
Copy Markdown

Backport: #913

errors.IsRetryable only checks the HTTP status codes to determine if a retry is appropriate.

We should consider transport errors, such as timeouts and connection refused issues to also be retryable, as they might disappear without configuration changes.

As per Go documentation [1], any net/http method (which gophercloud uses) should return url.Error when a transport error occurs. This provides a Timeout() and Temporary() method [2] which we can use to determine, if the operation can be reasonably retried. Additionally, we check for some syscall errors such as ECONNREFUSED and ECONNRESET explicitly and retry on them aswell.

[1] https://pkg.go.dev/net/http#Client.Do
[2] https://pkg.go.dev/net/url#Error

Fixes #879

errors.IsRetryable only checks the HTTP status codes to determine
if a retry is appropriate.

We should consider transport errors, such as timeouts and connection
refused issues to also be retryable, as they might disappear without
configuration changes.

As per Go documentation [1], any net/http method (which gophercloud uses)
should return url.Error when a transport error occurs.
This provides a Timeout() and Temporary() method [2] which we can use
to determine, if the operation can be reasonably retried.
Additionally, we check for some syscall errors such as ECONNREFUSED and
ECONNRESET, and some io errors explicitly and retry on them aswell.

[1] https://pkg.go.dev/net/http#Client.Do
[2] https://pkg.go.dev/net/url#Error

On-behalf-of: SAP nils.gondermann@sap.com

Fixes #879
@github-actions github-actions Bot added v2.0 This PR targets v2.0 semver:patch No API change labels Oct 13, 2026
@mandre
mandre added this pull request to the merge queue Oct 13, 2026
Merged via the queue into release-2.0 with commit 15e0c25 Oct 13, 2026
10 checks passed
@mandre
mandre deleted the bp-release-2.0-6ca3140 branch October 13, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:patch No API change v2.0 This PR targets v2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants