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

Wrong HTTP status for timeout?

オープン
#21 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
Go
スター
1.1k
フォーク
118
平均マージ
42分
マージ済み PR(30日)
2

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

提供されたDockerfileを使用してタイムアウトを再現し、curlで文書化されたInvocationエンドポイントにPOSTしてください。エミュレーターの200レスポンスとヘッダーを、リンク先の記事で説明されている実際のLambdaの動作と比較し、そのうえで期待されるステータスとヘッダーを確定してください。タイムアウトのレスポンスがその動作と一致すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
aws, dockerfile, go, node.js
領域
api, backend, cloud
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。