Skip to content

[fix]: handle 429 and 002 errors during linodemachine creation #404

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

Merged
merged 2 commits into from
Jul 10, 2024

Conversation

rahulait
Copy link
Collaborator

@rahulait rahulait commented Jul 9, 2024

What this PR does / why we need it:
If too many requests are made to linodeAPI in a short span of time, it returns 429 error. This PR handles 429 errors and makes sure we retry creating machine after some time. Similarly, if there is client timeout or unexpected EOF errors, we get 002 as returncode. This PR handles those errors as well.
Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

Copy link

codecov bot commented Jul 9, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 65.99%. Comparing base (31917b5) to head (7d89ca2).

Files Patch % Lines
controller/linodemachine_controller.go 0.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #404      +/-   ##
==========================================
- Coverage   66.06%   65.99%   -0.08%     
==========================================
  Files          42       42              
  Lines        2620     2623       +3     
==========================================
  Hits         1731     1731              
- Misses        794      796       +2     
- Partials       95       96       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rahulait rahulait force-pushed the handle-api-errors branch 2 times, most recently from f6c015e to 30501b6 Compare July 10, 2024 17:06
@rahulait rahulait marked this pull request as ready for review July 10, 2024 17:06
@rahulait rahulait force-pushed the handle-api-errors branch 2 times, most recently from 4a85dfd to 7d89ca2 Compare July 10, 2024 20:53
AshleyDumaine
AshleyDumaine previously approved these changes Jul 10, 2024
@rahulait rahulait force-pushed the handle-api-errors branch from ada06ac to 03211de Compare July 10, 2024 22:50
@rahulait rahulait merged commit 98677e6 into main Jul 10, 2024
10 checks passed
@eljohnson92 eljohnson92 changed the title fix: handle 429 and 002 errors during linodemachine creation [fix]: handle 429 and 002 errors during linodemachine creation Jul 11, 2024
@AshleyDumaine AshleyDumaine deleted the handle-api-errors branch August 9, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants