fix(netbox): retry network failures and surface fetch error cause - #470
Open
horner wants to merge 2 commits into
Open
fix(netbox): retry network failures and surface fetch error cause#470horner wants to merge 2 commits into
horner wants to merge 2 commits into
Conversation
undici reports DNS/connect/TLS failures as a bare 'fetch failed', hiding the real reason in err.cause. Log the cause and URL, and retry network-level failures (3 attempts, backoff). HTTP error responses are not retried. Fixes #469
Contributor
There was a problem hiding this comment.
Pull request overview
Improves the NetBox integration used during container lifecycle operations by adding retry/backoff behavior for network-level fetch() failures and by surfacing the underlying undici error cause in the thrown message, addressing the opaque “fetch failed” reported in #469.
Changes:
- Added
fetchWithRetry()with configurable attempts and linear backoff for network failures. - Routed
nbFetch()throughfetchWithRetry()so NetBox API calls benefit from retry behavior. - Improved failure messaging to include request method/URL and underlying
err.causedetails.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Rethrow non-network exceptions (bad URL, abort) immediately instead of retrying them and masking the original error.
Member
Author
|
Addressed in 6c7326e: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #469
nbFetchnow goes throughfetchWithRetry: 3 attempts with linear backoff on network-level errors (DNS, connect, TLS). HTTP error responses still throw immediately.err.cause.code(e.g.EAI_AGAIN,ECONNREFUSED) and the request URL instead of the opaquefetch failed.Verified NetBox itself was healthy and the failing request never reached nginx — see the issue for the investigation.