Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't retry POST requests with 429 error status #288

Open
Chipe1 opened this issue Nov 7, 2024 · 1 comment
Open

Doesn't retry POST requests with 429 error status #288

Chipe1 opened this issue Nov 7, 2024 · 1 comment

Comments

@Chipe1
Copy link

Chipe1 commented Nov 7, 2024

The default retryCondition isNetworkOrIdempotentRequestError only retries for 429 rate limiting when the request type is one of IDEMPOTENT_HTTP_METHODS, but ideally 429 means that the request was rejected without starting the execution so it should be safe to retry.
Using code in this comment as a work-around for now.

@Jeremy-F
Copy link

I completely understand your frustration—I'm also in a situation where I need to make batch requests with the POST method to external APIs, so thanks a lot for your workaround!

That said, I can also appreciate the intent of the library's authors here. The decision to restrict retries to idempotent methods is a reasonable safety measure, especially when dealing with potentially costly operations. Additionally, the fact that the retryCondition option allows for customization, and that isNetworkOrIdempotentRequestError is exposed, offers a manageable way to override the default behavior when needed. In that sense, the approach feels quite rational.

However, I agree with you that the limitation on retries to idempotent methods is under-documented. It’s buried within the retryCondition parameter’s description, which isn’t intuitive. I set up the library this morning, went through the README, and even dove into the source to adjust the retryDelay, but I hadn’t noticed this particular restriction until encountering it here. More explicit documentation in the README would go a long way in improving developer experience and clarifying behavior expectations upfront.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants