Fix ConnectionClosedException propagating uncaught to Netty event loop#454
Closed
lucassaldanha wants to merge 22 commits intolibp2p:masterfrom
Closed
Fix ConnectionClosedException propagating uncaught to Netty event loop#454lucassaldanha wants to merge 22 commits intolibp2p:masterfrom
lucassaldanha wants to merge 22 commits intolibp2p:masterfrom
Conversation
Quic secure transport implementation --------- Co-authored-by: Anton Nashatyrev <anton.nashatyrev@gmail.com>
* Relay local/remote multiaddress retrieval to Transport implementations to get rid of subclass checks
* chore: add or force update .github/workflows/stale.yml * chore: add or force update .github/workflows/generated-pr.yml
--------- Co-authored-by: Anton Nashatyrev <Nashatyrev@users.noreply.github.com>
fixed the problem of openjdk images being gone
* Updated rpc protobuf definition for partial messages * fix spaces * fix typo
…xChannel.doWrite 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ConnectionClosedExceptionto escapeMuxChannel.doWrite()uncaught, surfacing as spuriousPLEASE FIX OR REPORTnoise in Teku logs.throw+catchpattern caught the exception locally, but the subsequentbuf.remove(cause)call — sitting outside any try/catch — can propagate exceptions back through promise-listener callbacks in certain Netty versions.localDisconnectedcheck outside the try/catch and wrapbuf.remove(cause)defensively so nothing can escapedoWrite(). Pending write promises are still properly failed withConnectionClosedException.Test plan
MuxHandlerAbstractTestthat setslocalDisconnected = truewhile the channel is still active (simulating the window between flag assignment anddeactivate()indoDisconnect()), callswriteAndFlush, and asserts the write future is failed withConnectionClosedException— no uncaught exception./gradlew :libp2p:test --tests "io.libp2p.mux.*"— all 34 mux tests pass