Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@jlizen
Copy link
Contributor

@jlizen jlizen commented May 3, 2025

fixes: #848

Currently, cargo lambda watch only exposes extension API routes for 'bare' endpoints that don't have function names in them, ie:

/2020-01-01/extension/register
/2020-01-01/extension/event/next

Meanwhile, when an internal extension (running in the same process as the primary function) makes API calls, it is prefixed with the function name, ie:

/_/2020-01-01/extension/register
/_/2020-01-01/extension/event/next

This causes any function-scoped extension calls to fall through to fallback handlers and error. In practice, this results in the function hanging on extension registration and the function never exiting the init phase.

This problem was alluded to when internal extension support was first added to the aws-lambda-rust-runtime:
aws/aws-lambda-rust-runtime#744 (comment)

Meanwhile the Lambda orchestrator running in AWS does accept the function name-prefixed extension API calls.

Adding in support for this use case by adding the name-prefixed paths to our watch command's axum router, similar to how we have them for other (non-extension-related) routes.

Testing

See #848 for full testing information.

In short, this example from the aws-lambda-rust-runtime, previously hung indefinitely when run locally, but worked fine when deployed to AWS. It now runs properly locally.

I didn't update any unit test, integration tests, etc. Let me know if I should.

Copy link
Collaborator

@calavera calavera left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

@calavera calavera merged commit 87f2f83 into cargo-lambda:main May 4, 2025
7 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented May 4, 2025

This pull request has been automatically locked. Create a new discussion if you'd like to continue the conversation. https://github.com/cargo-lambda/cargo-lambda/discussions/new?category=general

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 4, 2025
@calavera
Copy link
Collaborator

calavera commented May 6, 2025

Version 1.8.5 released with this patch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cargo watch/invoke: hangs when registering internal extensions from inside function binary

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.