Commit e7516c4
fix(init): drain the reset-interrupted init failure so it cannot mask the suppressed init's real error
After the timeout path resets the in-progress init, awaitInitCompletion is
parked sending a ResetReceived failure on the unbuffered initFailures
channel. The first invoke's Reserve()/awaitInitialized() consumed it and
cached a generic placeholder error (Sandbox.Failure with an EMPTY payload,
see the ErrInitResetReceived handling in Invoke), which took precedence over
the real failure when the suppressed init re-run crashed without calling
/init/error: the invocation returned an empty error payload instead of e.g.
Runtime.ExitError "Runtime exited with error: exit status 1" (AWS-validated
by test_lambda_init_timeout_then_crash in localstack-pro).
Drain the notification right after the synchronous reset, so the invoke's
awaitInitialized() observes the closed channel, treats the init outcome as
pending, and the suppressed init's own result stays authoritative. This also
unparks the awaitInitCompletion goroutine for environments that time out
their init but never receive an invoke.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent cc2d7e2 commit e7516c4
2 files changed
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
320 | 325 | | |
321 | 326 | | |
322 | 327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
54 | 69 | | |
55 | 70 | | |
56 | 71 | | |
| |||
0 commit comments