From 231178b00e92da7bb5c3296cbd3b82148bab535a Mon Sep 17 00:00:00 2001 From: akash1810 Date: Tue, 31 Dec 2024 09:27:54 +0000 Subject: [PATCH] feat: Increase S3 timeout to 5 seconds Since updating `@aws-sdk/client-s3` to v3.717.0 we've seen an increase of timeouts: > RequestTimeout: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed. See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html --- dist/index.js | 11 ++++++++++- src/index.ts | 10 ++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index 3325c2d..90dfc27 100644 --- a/dist/index.js +++ b/dist/index.js @@ -61721,7 +61721,16 @@ var main = async (options) => { credentials: (0, import_credential_providers.fromWebToken)({ roleArn, webIdentityToken: idToken - }) + }), + /* + Increase the timeout to 5 seconds as since updating `@aws-sdk/client-s3` to v3.717.0 we've seen an increase of timeouts: + > RequestTimeout: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed. + + See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html + */ + requestHandler: { + requestTimeout: 5 * 1e3 + } }) ); const keyPrefix = riffraffPrefix(mfest); diff --git a/src/index.ts b/src/index.ts index 7de3f9a..33a295e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -115,6 +115,16 @@ export const main = async (options: Options): Promise => { roleArn: roleArn, webIdentityToken: idToken, }), + + /* + Increase the timeout to 5 seconds as since updating `@aws-sdk/client-s3` to v3.717.0 we've seen an increase of timeouts: + > RequestTimeout: Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed. + + See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html + */ + requestHandler: { + requestTimeout: 5 * 1000, + }, }), ); const keyPrefix = riffraffPrefix(mfest);