-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error reporting for network & consensus errors #4015
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
bfdda22
to
ee7f997
Compare
llrnRunDataDiffusion registry apps appsExtra | ||
withRegistry $ \registry -> | ||
handleJust | ||
-- ignore exception thrown in connection handlers and diffusion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should provide a rationale on why we ignore these errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are already logged by the network layer. I'll update the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Included, I also caught a freshman mistake, check the diff 😁
ee7f997
to
76a6cf8
Compare
ouroboros-network-framework/src/Ouroboros/Network/RethrowPolicy.hs
Outdated
Show resolved
Hide resolved
@@ -86,12 +95,32 @@ data ErrorContext = OutboundError | |||
type RethrowPolicy_ = ErrorContext -> SomeException -> ErrorCommand | |||
|
|||
newtype RethrowPolicy = RethrowPolicy { | |||
runRethrowPolicy :: RethrowPolicy_ | |||
runRethrowPolicyPure :: RethrowPolicy_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the Pure
suffix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it is pure unlike runRethrowPolicy
.
Initially, I thought that runRethrowPolicyPure
won't be needed, but it's actually useful in consensusRethrowPolicy
.
76a6cf8
to
0ab33f9
Compare
0ab33f9
to
d84ff7a
Compare
@bolt12 I added a commit which ignores |
Hmm, I think this PR should be changed. Parts of it are inferior to what we already have, let me try to explain. The diffusion already has a top level handler which logs all exceptions (the only confusing part about it is that the tracer is called For this reason I will remove the part that introduced |
This allows the consensus to use it's error policy to wrap around the `Ouroboros.Network.Consensus.Node.runWith` to catch all initialisation errors without interfering with all the exceptions rethrown by the network layer.
Made `ExceptionInHandler` an existential type. This allows to catch all exceptions regardless of peer address type.
Renamed InitialisationTracer as DiffusionTracer: it not only logs initialisation messages but also terminal errors.
04937ed
to
cf8a8fb
Compare
bors merge |
4120: Cherry picked network changes for cardano-node-1.35.5 release r=coot a=coot This cherry-picked patches from the following PRs: * #3794 * #3844 * #3785 * #3904 * #3915 * #3852 * #3970 * #3979 * #4015 * #4067 * #4004 * #4086 * #4113 * #4106 * #4127 * #4103 Also cherry-picked almost all the commits which modify GitHub actions: * 18c5244 Run GitHub Actions on pull requests * 3adf5a9 Use newer version of io-sim * ee9b7a6 Fix GH Actions Windows CI: switch from pkgconf to pkg-config * e6cf074 github-actions: use `ubuntu-latest` * 9a8b959 Updated versions of github actions * fc8f8f0 Fix GH Actions Windows CI caching * 7f07c40 Windows Github Actions now use MSYS2 * b21a7ce Fix chocolatey CI error * #4134 TODO: * [x] bump versions of packages * [x] input-output-hk/cardano-haskell-packages#84 Co-authored-by: Mark Tullsen <tullsen@galois.com> Co-authored-by: Marcin Szamotulski <coot@coot.me>
Description
runRethrowPolicy
logs the exception through a separate tracer:RethrowPolicyTracer
. A seprate tracer will allow to not use a configurationto disable it in
cardano-node
.Also added a top level handler for exceptions thrown by the consensus code.
This tracer should also not be configurable. To avoid duplication it does not
log diiffusion startup failure exceptions and exceptions that were rethrown
from connection handler thread (which are wrapped in
ExceptionInHandler
).Fixes #4000.
Checklist
interface-CHANGELOG.md
interface-CHANGELOG.md