-
Notifications
You must be signed in to change notification settings - Fork 699
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
Revisit and unify error handling in subsystems #752
Comments
I think this is useful for logging. |
In general, yes. At this very point, I'm not sure. The point is that if we want strongly typed errors we also want to convert between them when the fatal ones propagate. When runtime API request results in And if we do differentiate them, and we want to add one more variant like The subsys will still be able to log an exact position where the error is happened if it's important in any particular location but it shouldn't overburden the caller with the information which is too specific to it. Does it make sense? |
The line number in the log would resolve the issue, but I'm not sure if it's available in non-debug builds. |
In this case it does in all 3 cases. |
@slumber I mean, if we fail during, say, So we still log what happened exactly, and letting the caller know that something has screwed up but without details which are redundant to the caller. |
But in general it's not the rule. This issue doesn't target backing in particular, right? |
I think this is the case in most cases where we make a request to a subsystem that doesn't cancel its tasks (i.e. not job-based). We could have a generic fatal error
Yes, for example in av-store we have a custom error with manual |
* refactor: use weightToFee for xcm Trader * fix format
After some discussion with @s0me0ne-unkn0wn about paritytech/polkadot#6161 (comment), we've noticed there are some inconsistencies in how we treat different errors wrt fatality.
For example, https://github.com/paritytech/polkadot/blob/795b20c7150b04759ebddadd419e2f26fa382519/node/subsystem-util/src/lib.rs#L85-L87
doesn't derive
#[fatality::fatality(splitable)]
and the caller treats all errors as non-fatal. Whereas some of them, likeOneshot
could be an indication of a node shutting down. There's a sub-module errors that does it better:https://github.com/paritytech/polkadot/blob/795b20c7150b04759ebddadd419e2f26fa382519/node/subsystem-util/src/runtime/error.rs#L25-L27
Another thing we've noticed is a lot of duplication in some places: https://github.com/paritytech/polkadot/blob/795b20c7150b04759ebddadd419e2f26fa382519/node/core/backing/src/error.rs#L49-L56
Probably we don't really need to distinguish between all of them.
The text was updated successfully, but these errors were encountered: