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

Adding a retry for 429 errors in common meraki apis #642

Merged
merged 2 commits into from
Dec 14, 2023
Merged

Conversation

i3149
Copy link
Contributor

@i3149 i3149 commented Dec 12, 2023

See if we hit a 429 code and retry for up to 5 times before giving up.

@i3149 i3149 requested a review from thezackm December 12, 2023 23:27
thezackm
thezackm previously approved these changes Dec 13, 2023
Copy link
Contributor

@thezackm thezackm left a comment

Choose a reason for hiding this comment

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

Do we know the impact of refreshing a 429 6 times over ~15sec? Wondering if there's a risk of throttling from Meraki?

Otherwise it looks great!

@i3149
Copy link
Contributor Author

i3149 commented Dec 13, 2023

So this is why the golang API is annoying. I have an open issue with the swagger spec to expose the header which tells you when to retry. But it hasn't been looked at since August /shrug. Without this header, you're kinda just guessing on how long to wait for. Python defaults to a random number between 1 and 60 sec to sleep. Possibly we should do this? Agree, 5 is kinda a lot of retries, maybe make this 2?

@thezackm
Copy link
Contributor

What about a hard cap? User-configurable 0-10 (default: 2) at 5 sec interval?

That would max at 55 seconds for folks trying the 60s poll interval.

@i3149
Copy link
Contributor Author

i3149 commented Dec 13, 2023

Deal, will change over to this logic.

@i3149 i3149 merged commit e5c428c into main Dec 14, 2023
1 check passed
@i3149 i3149 deleted the retry-meraki branch December 14, 2023 18:11
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.

2 participants