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

Add retries to the fetching of jobs data #1909

Merged
merged 5 commits into from
Jun 27, 2024

Conversation

abdullah-kasim
Copy link
Contributor

@abdullah-kasim abdullah-kasim commented Jun 26, 2024

Description

We've received a few errors on this endpoint that can be mitigated by simply fetching the data again by retrying. The error is intermittent, and is likely because the endpoint returned a 500 - hence no longer a JSON and we could ignore it.

This PR adds retrying to the job fetch API safely - by limiting the retries only to this specific error. This is so that we don't accidentally retry on other errors such as rate limiting, or valid errors like permission errors!

Pull request checklist

New release checklist

Steps to Test

The unit tests should be fine - changes are pretty minor.

Copy link
Contributor

github-actions bot commented Jun 26, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

@abdullah-kasim abdullah-kasim requested a review from a team June 26, 2024 10:02
Copy link

Copy link
Member

@sanmai sanmai left a comment

Choose a reason for hiding this comment

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

👍

@@ -0,0 +1,211 @@
// copied over from our internal lib
Copy link
Member

Choose a reason for hiding this comment

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

This all looks pretty neat. I wonder if we should GPL it as a separate package 🤔

https://github.com/Automattic/vip-go-node-internal/blob/3895523d8176ea1a9644aebd8acf9078c1126789/src/utils/retry/retry.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fun to think about! It's MIT now 😅 , but copyright is ours indeed if we plan to change the license. I honestly don't see much of a benefit of whichever license - it's a pretty common tool.

@abdullah-kasim abdullah-kasim merged commit 47afac2 into trunk Jun 27, 2024
16 checks passed
@abdullah-kasim abdullah-kasim deleted the fix/creating-backup-copy-error branch June 27, 2024 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants