Skip to content

Commit

Permalink
Fix rethrow policy
Browse files Browse the repository at this point in the history
UnknownMiniProtocol errors, even on the outbound side, should not
trigger a node shutdown.
  • Loading branch information
crocodile-dentist committed Feb 3, 2025
1 parent e91d5c4 commit 653d62e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions ouroboros-network/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* Use `LocalRootConfig` instead of a tuple.
* Extended `LocalRootConfig` with `diffusionMode :: DiffusionMode` field.
* Added `diConnStateSupply` record field to `Ouroboros.Network.Diffusion.P2P.Interfaces`.
* UnknownMiniProtocol error should not crash the node

### Non-Breaking changes

Expand Down
5 changes: 1 addition & 4 deletions ouroboros-network/src/Ouroboros/Network/Diffusion/P2P.hs
Original file line number Diff line number Diff line change
Expand Up @@ -745,11 +745,8 @@ runM Interfaces
Nothing -> mempty)
<>
RethrowPolicy (\ctx err -> case (ctx, fromException err) of
-- mux unknown mini-protocol errors on the outbound
-- side are fatal, since this is misconfiguration of the
-- ouroboros-network stack.
(OutboundError, Just Mx.UnknownMiniProtocol {})
-> ShutdownNode
-> ShutdownPeer
_ -> mempty)


Expand Down

0 comments on commit 653d62e

Please sign in to comment.