Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong HTTP status for timeout? #21

Open
jscheid opened this issue Jan 19, 2021 · 0 comments
Open

Wrong HTTP status for timeout? #21

jscheid opened this issue Jan 19, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@jscheid
Copy link

jscheid commented Jan 19, 2021

With a simple Dockerfile that always times out after 1s:

FROM public.ecr.aws/lambda/nodejs:12
RUN echo 'exports.handler = (_event, _context, cb) => { setTimeout(() => {}, 100000) }' > index.js
ENV AWS_LAMBDA_FUNCTION_TIMEOUT=1
CMD ["index.handler"]

Hitting the endpoint:

$ curl -qv http://localhost:8080/2015-03-31/functions/function/invocations -d '{}'
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8080 (#0)
> POST /2015-03-31/functions/function/invocations HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.64.1
> Accept: */*
> Content-Length: 2
> Content-Type: application/x-www-form-urlencoded
> 
* upload completely sent off: 2 out of 2 bytes
< HTTP/1.1 200 OK
< Date: Tue, 19 Jan 2021 02:38:17 GMT
< Content-Length: 33
< Content-Type: text/plain; charset=utf-8
< 
* Connection #0 to host localhost left intact
Task timed out after 1.00 seconds* Closing connection 0

Returns status code 200 and no special response headers.

I didn't find conclusive documentation on what exactly should happen, but the screenshot on this page seems to suggest that a "real" lambda would return 502.

@ghost ghost added the bug Something isn't working label Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant