fix: watch: add missing extension API endpoints for internal extension calls from inside functions #849
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes: #848
Currently,
cargo lambda watchonly exposes extension API routes for 'bare' endpoints that don't have function names in them, ie: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:
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
watchcommand'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.