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

fix: Handle 429s in the client #1830

Merged
merged 4 commits into from
Oct 10, 2024
Merged

Conversation

msfstef
Copy link
Contributor

@msfstef msfstef commented Oct 10, 2024

Fixes #1770

With #1787 we've managed to return 429s whenever there's too many concurrent shape creations that cause the database connection pool to be exhausted.

This PR just ensures that the client does indeed retry on 429s - for now just with our regular exponential backoff, as there is no standard for retry headers to respect.

P.S. additional changes to the openapi spec done by my formatter 👀 I can roll them back if you think they are worse than before

Copy link

netlify bot commented Oct 10, 2024

Deploy Preview for electric-next ready!

Name Link
🔨 Latest commit ea104f3
🔍 Latest deploy log https://app.netlify.com/sites/electric-next/deploys/6707cad41fe7f600083873b9
😎 Deploy Preview https://deploy-preview-1830--electric-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

packages/typescript-client/src/fetch.ts Outdated Show resolved Hide resolved
@msfstef msfstef force-pushed the msfstef/handle-429s-in-the-client branch from 563c084 to be12203 Compare October 10, 2024 13:16
@msfstef msfstef force-pushed the msfstef/handle-429s-in-the-client branch from be12203 to a551fe8 Compare October 10, 2024 15:00
@msfstef msfstef merged commit c0c9af6 into main Oct 10, 2024
22 of 23 checks passed
@msfstef msfstef deleted the msfstef/handle-429s-in-the-client branch October 10, 2024 15:04
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

Successfully merging this pull request may close these issues.

Queue requests and return 429s when the server gets overloaded
2 participants