Skip to content

Commit f437545

Browse files
committed
feat(sdk): configure Lambda client timeouts
Add connection and socket timeout configurations to LambdaClient to improve reliability: - connectionTimeout: 5000ms (5 seconds) - socketTimeout: 50000ms (50 seconds) This helps prevent hanging requests and provides better error handling for Lambda API calls. Updated api-storage test to verify LambdaClient is initialized with timeout settings.
1 parent efa419a commit f437545

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ 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+
},
64+
});
6065
});
6166

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

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ 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+
},
25+
});
2126
}
2227

2328
/**

0 commit comments

Comments
 (0)