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

The "Init Duration" reported by the RIE is wrong

未关闭
#106 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement good first issue
主要语言
Go
星标
1.1k
派生
118
平均合并
42 分钟
30 天内合并 PR
2

描述

The "Init Duration" reported by the RIE is much too small. It is taken [before the actual language runtime is even started](https://github.com/aws/aws-lambda-runtime-interface-emulator/blob/2057adac54dbd781b51431f775363ec021648c77/cmd/aws-lambda-rie/handlers.go#L98):
```go
initStart, initEnd := InitHandler(sandbox, functionVersion, timeout, bs)
```

Instead, the end of the Init phase should be recorded when the [`sendInitRuntimeDoneLogEvent()`](https://github.com/aws/aws-lambda-runtime-interface-emulator/blob/2057adac54dbd781b51431f775363ec021648c77/lambda/rapid/handlers.go#L358) is posted:
```go
defer func() {
sendInitRuntimeDoneLogEvent(execCtx, sbInfoFromInit.SandboxType, runtimeDoneStatus)
}()
```

贡献指南

打开贡献指南

调研方向

从 cmd/aws-lambda-rie/handlers.go 中的 InitHandler 调用开始,然后跟踪 init 生命周期,直到 lambda/rapid/handlers.go 和 sendInitRuntimeDoneLogEvent()。验证 Init 阶段何时结束,并确保报告的 Init Duration 包含 language runtime 启动时间;将生成的 RIE 日志事件与预期 timing 进行比较。

由索引模型根据 Issue 内容生成。

评估

技术栈
go
领域
tooling
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
68/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。