-
Notifications
You must be signed in to change notification settings - Fork 637
Closed
Labels
bugThis issue is a bug.This issue is a bug.p2This is a standard priority issueThis is a standard priority issuequeuedThis issues is on the AWS team's backlogThis issues is on the AWS team's backlog
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
The SDK does not retry if network is unavailable
SDK version number
All
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
All
Reproduction Steps
The v2 source code for comparison
import AWS from "aws-sdk";
const client = new AWS.S3({ logger: console });
try {
await client.listBuckets().promise();
} catch (error) {}Disable the network, and run the test code.
In the output, you can see that three retries were made
[AWS s3 undefined 0.25s 3 retries] listBuckets({})An equivalent code in v3
import { S3 } from "@aws-sdk/client-s3";
const client = new S3();
await client.listBuckets();Observed Behavior
When run after disabling the network, the $metadata indicates retry attempts were not made
node:internal/modules/run_main:129
triggerUncaughtException(
^
Error: getaddrinfo ENOTFOUND s3.us-west-2.amazonaws.com
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 's3.us-west-2.amazonaws.com',
'$metadata': { attempts: 1, totalRetryDelay: 0 }
}Expected Behavior
The error should still be thrown since network is disabled, but after four attempts (three retries) as follows
node:internal/modules/run_main:129
triggerUncaughtException(
^
Error: getaddrinfo ENOTFOUND s3.us-west-2.amazonaws.com
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 's3.us-west-2.amazonaws.com',
'$metadata': { attempts: 4, totalRetryDelay: 357 }
}Possible Solution
Process ENOTFOUND from Node.js as a retryable error?
Additional Information/Context
The internal specification for retries says
A response can be retryable based on various attributes:
- Connection errors, defined as any error received by the SDK in which we were unable to receive an HTTP response from the service.
yukihato
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.p2This is a standard priority issueThis is a standard priority issuequeuedThis issues is on the AWS team's backlogThis issues is on the AWS team's backlog