Skip to content

Conversation

sebsto
Copy link
Collaborator

@sebsto sebsto commented Oct 16, 2025

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 next GET /next request.

Result:

You can now send multiple invocations to your streaming lambda.

@sebsto sebsto requested a review from Copilot October 16, 2025 18:59
@sebsto sebsto self-assigned this Oct 16, 2025
@sebsto sebsto added kind/bug Feature doesn't work as expected. 🔨 semver/patch No public API change. labels Oct 16, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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.

@sebsto sebsto requested a review from Copilot October 16, 2025 19:27
Copy link
Contributor

@Copilot Copilot AI left a 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.

@sebsto sebsto requested a review from 0xTim October 16, 2025 19:27
@sebsto sebsto marked this pull request as ready for review October 16, 2025 19:32
Copy link
Contributor

@adam-fowler adam-fowler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@sebsto sebsto merged commit 8116ba3 into awslabs:main Oct 17, 2025
38 checks passed
@sebsto sebsto deleted the sebsto/fix_588 branch October 17, 2025 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Feature doesn't work as expected. 🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants