Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

feat!: stop retrying on 5xx responses #726

Merged
merged 1 commit into from
Jul 21, 2022
Merged

Conversation

eduardoboucas
Copy link
Member

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.

@eduardoboucas eduardoboucas added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Jul 21, 2022
@biruwon biruwon self-requested a review July 21, 2022 08:43
Copy link

@biruwon biruwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@eduardoboucas eduardoboucas merged commit d0328e9 into main Jul 21, 2022
@eduardoboucas eduardoboucas deleted the feat/limit-retry branch July 21, 2022 11:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants