How to handle rate limiting for glacier? #1656
-
Confirm by changing [ ] to [x] below:
Describe the question As asked on SO: https://stackoverflow.com/questions/69089033/how-to-handle-rate-limiting-using-the-aws-glacier-sdk I have a glacier client like this:
trying to delete ~1Mio archives from glacier vault in a loop, using 16 workers, I'm running into:
How can I configure the SDK to handle the rate limiting? Note: what seems strange is that the API responds with HTTP 400 for rate limiting, I would have expected HTTP 429? |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments
-
Hi @andig , |
Beta Was this translation helpful? Give feedback.
-
Thanks for the idea! Unfortunately, it seems as if this is still hard to use (adding
|
Beta Was this translation helpful? Give feedback.
-
I mean there is not a huge difference between 3 attempts and 5, I was thinking more on like 30 so that the exponential backoff comes in. |
Beta Was this translation helpful? Give feedback.
-
Sorry, I may not be doing what you've suggested, here's the code now with 60 attempts:
The error is still the same though:
The retry quota error here is different from the initial error which was
So it doesn't seem to be that the attempts are exhausted. I'm failing to unterstand which know to turn to make the backoff behave like you've suggested? |
Beta Was this translation helpful? Give feedback.
-
Might this somehow be related to #1413? |
Beta Was this translation helpful? Give feedback.
-
That is super weird, because it's not immediately apparent that that Max value is actually applied there correctly. It might not be related to that issue but the "problem" if it exists, is certainly somewhere around that code. |
Beta Was this translation helpful? Give feedback.
-
I can share the entire code- its just boilerplate leading up to whats shown above. |
Beta Was this translation helpful? Give feedback.
-
cheers, that might help me writing some test code |
Beta Was this translation helpful? Give feedback.
-
@andig Ah mate, I think your stuff is different. That ticket is about the middleware retrier which is configured through Here is some more documentation about that with examples: https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry That said, it's not that yours shouldn't be working.. |
Beta Was this translation helpful? Give feedback.
-
The retry docs didn't gibt enlightenment. I'm still stuck with this- any more insights? |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Hi @andig ,
So the exponential backoff is meant to handle this but you are now hitting the max retry attempts so, the next thing I would suggest is specifying a bigger max retries so that the exponential wait gets to grow enough to avoid the throttling.
Look here for documenation, and let me know if this helped or if you got more questions on this.