aws / aws/aws-lambda-runtime-interface-emulator

Wrong HTTP status for timeout?

Đang mở
#21 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Go
Star
1.1k
Fork
118
Merge trung bình
42 phút
Pull request đã merge (30 ngày)
2

Mô tả

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

```Dockerfile
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](https://theburningmonk.com/wp-content/uploads/2019/05/img_5ce5e801baffb.png) on [this page](https://theburningmonk.com/2019/05/how-to-log-timed-out-lambda-invocations/) seems to suggest that a "real" lambda would return 502.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Reproduce the timeout using the provided Dockerfile and POST to the documented invocation endpoint with curl. Compare the emulator’s 200 response and headers with the real Lambda behavior described in the linked article, then establish the expected status and headers; done means timeout responses match that behavior.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
aws, dockerfile, go, node.js
Lĩnh vực
api, backend, cloud
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.