Skip to content

Context Deadline for Lambda Running from API GW #580

Open
@js10x

Description

@js10x

When running a lambda handler that is executed from an API Gateway integration, does the context timeout align with the timeout set on the lambda function itself? I am getting context deadline exceeded errors when the invoke takes a little longer than ~2 seconds, despite me having a 15 minute timeout on the lambda itself.

Sample:

func main() {
 lambda.StartWithOptions(handler, lambda.WithContext(context.Background())
}

func handler(ctx context.Context, req *events.APIGatewayProxyRequest) (*events.APIGatewayProxyResponse, error) {
 // code runs here that takes ~2 seconds or more, but less than 15 minutes (timeout set on lambda)
 return nil, nil // omitted for brevity
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions