Skip to content

How to handle rate limiting for glacier? #1405

@andig

Description

@andig

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:

cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithRegion("eu-west-1"),
    config.WithRetryer(func() aws.Retryer {
        return retry.AddWithMaxBackoffDelay(retry.NewStandard(), time.Second*5)
    }),
)

client := glacier.NewFromConfig(cfg)

trying to delete ~1Mio archives from glacier vault in a loop, using 16 workers, I'm running into:

operation error Glacier: DeleteArchive, exceeded maximum number of attempts, 3, https response error StatusCode: 400, 
RequestID: pmkKm45AI3tNzMSUp5PKP84QoanLYHHEpaZ-WXsxsv1v8mc, api error ThrottlingException: Rate exceeded

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?

Metadata

Metadata

Assignees

Labels

guidanceQuestion that needs advice or information.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions