Commit 72315ae
authored
fix: prevent pipeline errors from killing Reactor subscription (#205)
The pipeline used doOnNext to chain handlers, but onErrorContinue does
not work reliably with doOnNext (a known Reactor limitation). When a
StackOverflowError escaped a handler, it could intermittently terminate
the Reactor subscription, causing the node to stop processing all
subsequent incoming packets.
Wrap each handler invocation in a try-catch within the pipeline so errors
are contained at the handler level and never propagate to Reactor.
Also add catch(Throwable) to HandshakeMessagePacketHandler for
defense-in-depth, matching the existing pattern in MessagePacketHandler.1 parent 77b1e42 commit 72315ae
2 files changed
Lines changed: 19 additions & 1 deletion
File tree
- src/main/java/org/ethereum/beacon/discovery/pipeline
- handler
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
33 | 44 | | |
34 | 45 | | |
35 | 46 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
154 | 161 | | |
155 | 162 | | |
156 | 163 | | |
| |||
0 commit comments