aws / aws/aws-lambda-runtime-interface-emulator
The "Init Duration" reported by the RIE is wrong
- Vorherrschende Sprache
- Go
- Sterne
- 1.1k
- Forks
- 118
- Ø Merge
- 42 Min.
- Gemergte PRs (30 T.)
- 2
Beschreibung
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)
}()
```
Beitragsleitfaden
Rechercherichtung
Start in cmd/aws-lambda-rie/handlers.go at the InitHandler call, then follow the init lifecycle to lambda/rapid/handlers.go and sendInitRuntimeDoneLogEvent(). Verify when the Init phase ends and ensure the reported Init Duration includes language runtime startup; compare the resulting RIE log event with the expected timing.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- go
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 68/100