This repository has been archived by the owner on Oct 10, 2022. It is now read-only.
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.
Summary
The JavaScript API client currently has a global retry mechanism that will retry on 429 and 5xx responses. At the same time, there's a a separate retry mechanism for file and function uploads in the CLI, which retries any error.
This means that for any 5xx errors happening in function or file uploads, there are two separate retry mechanisms kicking in in the CLI.
In contrast, the Go API client has a global retry mechanism at the transport level, which retries only on responses with the 429 status code, and a separate retry mechanism for file and function uploads.
This PR makes the JavaScript client aligned with the Go client, by making the global retry only handle 429s.
There is one exception, though. In https://github.com/netlify/bitballoon/issues/9616, we've added retries to 5xx errors because of a specific endpoint that occasionally failed. In order to avoid disruption, this PR contains a special case for that endpoint, keeping the existing behaviour.
I would recommend that we remove that special case in a future release.