Commit 9445f0d
authored
Fix ConnectionClosedException propagating to Netty event loop from MuxChannel.doWrite (libp2p#455)
In Netty 4.2.x the original code's throw+catch pattern caused the exception to
escape doWrite() uncaught, surfacing as spurious "PLEASE FIX OR REPORT" noise in
Teku logs. The throw was caught locally, but buf.remove(cause) — called from the
catch block without its own guard — can propagate exceptions back through
promise-listener callbacks in certain Netty versions.
Fix: move the localDisconnected check outside the try/catch and wrap the
buf.remove(cause) call defensively so nothing can escape doWrite(). Pending write
promises are still properly failed with ConnectionClosedException.1 parent 77f7625 commit 9445f0d
2 files changed
Lines changed: 31 additions & 3 deletions
File tree
- libp2p/src
- main/kotlin/io/libp2p/etc/util/netty/mux
- test/kotlin/io/libp2p/mux
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
38 | 48 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
| |||
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
442 | 443 | | |
443 | 444 | | |
444 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
445 | 466 | | |
446 | 467 | | |
447 | 468 | | |
| |||
0 commit comments