Commit 966c9e2
Forward panic handler through FilterError/IgnoreError wrappers
`efStage` (the wrapper returned by `FilterError` and `IgnoreError`)
embeds the `Stage` interface, which only exposes the four Stage methods.
So when `Pipeline.Start()` checks `if phs, ok := s.(StagePanicHandlerAware); ok`,
the assertion silently fails for any wrapped stage — even if the
underlying stage is a `goStage` that implements `SetPanicHandler`.
This means a configured `WithStagePanicHandler` is bypassed when the
panicking Function is wrapped in `IgnoreError`. The goroutine inside
`goStage.Start` sees `panicHandler == nil` and returns without calling
`recover()`, letting the panic propagate up the runtime and crash the
host process.
This was a pre-existing bug in main (not introduced by the version-2
Stage interface redesign), but we're already touching the panic-handler,
so let's fix it here.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 9f9a823 commit 966c9e2
2 files changed
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
29 | 44 | | |
30 | 45 | | |
31 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
532 | 532 | | |
533 | 533 | | |
534 | 534 | | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
535 | 564 | | |
536 | 565 | | |
537 | 566 | | |
| |||
0 commit comments