aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
3.12k stars 578 forks source link

Project does not respect API Ratelimits #1899

Closed Martmists-GH closed 3 years ago

Martmists-GH commented 3 years ago

Describe the bug Using the Polly API, by running a lot of requests, one can easy get ThrottlingException: Rate exceeded. Ratelimits should be expected to be handled by the API wrapper library, not by the end user.

SDK version number 0.1.0-preview.2

Is the issue in the browser/Node.js/ReactNative? Node.js

Details of the browser/Node.js/ReactNative version v15.5.1

To Reproduce (observed behavior) As we need to map a large amount of strings to audio representing those strings, we run approximately 500 requests asynchronously through the following code:

const {PollyClient} = require("@aws-sdk/client-polly-node");
const polly = new PollyClient({region: 'eu-west-1'});

polly.send(new SynthesizeSpeechCommand({
    OutputFormat: "mp3",
    Text: our_text,
    TextType: "text",
    VoiceId: "VOICE_HERE"
})

Expected behavior The API wrapper library handles the ratelimits.

trivikr commented 3 years ago

@MaryWeb The preview versions are old and are to be deprecated in https://github.com/aws/aws-sdk-js-v3/issues/1397

Please use GA version v3.2.0 of @aws-sdk/client-polly which uses new retry behavior with congestion control to accommodate throttling responses, and retry quotas to limit the number of failed retries.

github-actions[bot] commented 3 years ago

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

github-actions[bot] commented 3 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.