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

The "Init Duration" reported by the RIE is wrong

Ouverte
#106 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
enhancement good first issue
Langage dominant
Go
Étoiles
1.1k
Forks
118
Merge moyen
42 min
PR mergées (30 j)
2

Description

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)
}()
```

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
go
Domaine
tooling
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
68/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.