Skip to content

Commit 66bffe8

Browse files
authored
feat(sdk): configure Lambda client timeouts (#256)
Add connection and socket timeout configurations to LambdaClient: - connectionTimeout: 5000ms (5 seconds) - socketTimeout: 50000ms (50 seconds) This helps prevent hanging requests and provides better error handling for Lambda API calls. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent eb0c30c commit 66bffe8

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

packages/aws-durable-execution-sdk-js/src/storage/api-storage.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,13 @@ describe("ApiStorage", () => {
5656

5757
test("should initialize with correct endpoint and region", () => {
5858
// Verify that LambdaClient was constructed with the correct parameters
59-
expect(LambdaClient).toHaveBeenCalledWith();
59+
expect(LambdaClient).toHaveBeenCalledWith({
60+
requestHandler: {
61+
connectionTimeout: 5000,
62+
socketTimeout: 50000,
63+
requestTimeout: 5000,
64+
},
65+
});
6066
});
6167

6268
test("should call getStepData with correct parameters", async () => {

packages/aws-durable-execution-sdk-js/src/storage/api-storage.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ export class ApiStorage implements ExecutionState {
1717
protected client: LambdaClient;
1818

1919
constructor() {
20-
this.client = new LambdaClient();
20+
this.client = new LambdaClient({
21+
requestHandler: {
22+
connectionTimeout: 5000,
23+
socketTimeout: 50000,
24+
requestTimeout: 5000,
25+
},
26+
});
2127
}
2228

2329
/**

0 commit comments

Comments
 (0)