Does NodeJS AWS-SDK for Kinesis retries failures?


I'm trying to put records and when the throughput is heavy, it fails with the following error:

2022-09-22T14:40:19.780Z	9f683c06-e270-43ae-8dd4-b16ffa3df480	ERROR	Invoke Error 	
    "errorType": "Error",
    "errorMessage": "Unexpected error: http2 request did not get a response",
    "$metadata": {
        "attempts": 1,
        "totalRetryDelay": 0
    "stack": [
        "Error: Unexpected error: http2 request did not get a response",
        "    at ClientHttp2Stream.<anonymous> (/var/task/node_modules/@aws-sdk/node-http-handler/dist-cjs/node-http2-handler.js:105:28)",
        "    at ClientHttp2Stream.emit (events.js:400:28)",
        "    at ClientHttp2Stream.emit (domain.js:475:12)",
        "    at emitCloseNT (internal/streams/destroy.js:87:10)",
        "    at processTicksAndRejections (internal/process/task_queues.js:81:21)"

If I retry manually, the same records work. So, I wonder if the client has retries by default and if it doesn't, will putting retries catch this error and will retry the same request?

asked 2 years ago716 views
1 Answer

According to the following AWS official documentation, the AWS SDK has a retry feature, but the retry behavior seems to depend on the setting value. [1] [2]

[1] Error retries and exponential backoff in AWS - AWS General Reference

[2] Retry behavior - AWS SDKs and Tools

In AWS SDK for JavaScript, the number of retries can be set in the maxRetries global setting. [3] [4]

[3] Troubleshoot Lambda function retry and timeout issues when using an AWS SDK

[4] Using the Global Configuration Object - AWS SDK for JavaScript

I hope this helps.

profile picture
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions