-
Notifications
You must be signed in to change notification settings - Fork 118
Allow multiple invocations of streaming Lambda functions with the local test server #590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug in the local test server that prevented multiple invocations of streaming Lambda functions. The issue was that streaming responses weren't receiving the required HTTP 202 acknowledgment after posting the end chunk, causing the Lambda runtime to hang instead of processing the next request.
Key Changes:
- Added missing HTTP 202 response acknowledgment for streaming function end chunks
- Added comprehensive test coverage for streaming Lambda functions including multiple invocations, custom headers, and error handling
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
Sources/AWSLambdaRuntime/Lambda+LocalServer.swift | Added HTTP 202 acknowledgment response for streaming END chunks to allow runtime to continue processing |
Tests/AWSLambdaRuntimeTests/LambdaStreamingTests.swift | Added comprehensive test suite covering streaming handlers with multiple invocations, custom headers, and error scenarios |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
The Local HTTP Server (used when testing) used to block after one invocation of a streaming lambda function. Now you can invoke multiple times your streaming function without having to restart the local HTTP server.
Motivation:
Bug #588
Modifications:
The flow to respond to streaming and non-streaming requests are different. In the streaming request flow, we forgot to send an 202 accept response to the lambda runtime client after it posted the end chunck of the response (in other words,
POST /response
never received an HTTP 202 response.) This caused the Lambda Runtime to hang and never issue the nextGET /next
request.Result:
You can now send multiple invocations to your streaming lambda.