lambda-go-api-proxy makes it easy to port APIs written with Go frameworks such as Gin (https://gin-gonic.github.io/gin/ ) to AWS Lambda and Amazon API Gateway.
When using the ProxyWithContext function from the Fiber proxy, the context is immediately set to cancelled once it transitions from the Lambda context in the handler function to the Fiber fiber.Ctx struct. This results in subsequent API calls to AWS services that rely on the context to fail, as the context is already cancelled.
Runtime and configuration
API Gateway: Regional rest API
Lambda runtime: Amazon Linux 2023; arn:aws:lambda:eu-west-1::runtime:394919924951bb234aa650732bf2a1cc74b5e6aa1d263b5f333fbd029cc8e978
When using the
ProxyWithContext
function from the Fiber proxy, the context is immediately set to cancelled once it transitions from the Lambda context in the handler function to the Fiber fiber.Ctx struct. This results in subsequent API calls to AWS services that rely on the context to fail, as the context is already cancelled.Runtime and configuration
arn:aws:lambda:eu-west-1::runtime:394919924951bb234aa650732bf2a1cc74b5e6aa1d263b5f333fbd029cc8e978
1.23.1
github.com/gofiber/fiber/v2 v2.52.5
github.com/awslabs/aws-lambda-go-api-proxy v0.16.2
github.com/aws/aws-lambda-go v1.47.0
Reproducing the issue
Below a very simple fiber app that will fatal out with a error state.
Go code
Go mod file
Logging output: