Skip to content
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

Ensure that all panics are handled #870

Closed
jaekwon opened this issue Apr 16, 2018 · 10 comments
Closed

Ensure that all panics are handled #870

jaekwon opened this issue Apr 16, 2018 · 10 comments
Assignees
Labels
Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity.

Comments

@jaekwon
Copy link
Contributor

jaekwon commented Apr 16, 2018

Right before launch software finalization

@jaekwon jaekwon self-assigned this Apr 16, 2018
@martindale martindale added this to the 1.0 Code Freeze milestone Apr 24, 2018
@cwgoes cwgoes modified the milestone: 1.0 Code Freeze Apr 27, 2018
@ValarDragon
Copy link
Contributor

ValarDragon commented Jun 26, 2018

I thought we wanted to keep panics, so that things fail fast, and errors don't propagate. (As we'd prefer there not to be an unknown invariant broken somewhere)

@ValarDragon
Copy link
Contributor

Or should we have invariant failing panics create a circuit breaker message?

@ebuchman
Copy link
Member

We should have a discussion about this and document the actual strategy. It seems sometimes we're insistent about panics as part of an API (eg. nil keys in the KVStore) while other time's its not clear.

But there's also panics in many other parts of the code that might not be as well justified. Also we still panic in lots of places in the CLI when we find eg. empty accounts.

It would be very cool if we could catch panics and trigger the governance circuit breaker ...

@alexanderbez
Copy link
Contributor

I'd definitely would like to be part of that convo/design discussion. Panics on low-level ops are certainly warranted, but operations closer to user-space (e.g. txs that lead to an account not being found) and those that have the potential to be handled gracefully should probably have their respective errors bubbled upstream.

@cwgoes
Copy link
Contributor

cwgoes commented Jun 28, 2018

It would be very cool if we could catch panics and trigger the governance circuit breaker ...

For panics in the state machine, I think this is a very interesting idea, particularly in combination with something like #1381.

@mossid
Copy link
Contributor

mossid commented Jul 4, 2018

Maybe we can define type PanicHandler which can be used for handling panic messages. When any module makes panic, it goes to recover() in runTx, and passed to registered PanicHandler(in this case gov.NewPanicHandler()) if it is not core panic type(#1382).

@ValarDragon
Copy link
Contributor

Since we've punted the circuit breaker to postlaunch (AFAIK), should we keep all the panics prelaunch, so that the chain halts quickly?

@cwgoes
Copy link
Contributor

cwgoes commented Aug 20, 2018

Since we've punted the circuit breaker to postlaunch (AFAIK), should we keep all the panics prelaunch, so that the chain halts quickly?

I think so. It will be far, far easier to debug a problem if we halt quickly and figure out the cause rather than continue running the state machine and operate over a potentially more and more invalid state.

@jackzampolin
Copy link
Member

Sounds like based on the discussion above we are going to punt this #postlaunch. Adjusting labels accordingly.

@jackzampolin jackzampolin added post-launch Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity. labels Oct 12, 2018
@jackzampolin jackzampolin changed the title Ensure that all panics are dealt with Ensure that all panics are handled Oct 12, 2018
@jackzampolin jackzampolin removed this from the 1.0 Code Freeze milestone Jan 28, 2019
@jackzampolin
Copy link
Member

Going to close this issue as we are planning to keep panics in the state machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Code Hygiene General cleanup and restructuring of code to provide clarity, flexibility, and modularity.
Projects
None yet
Development

No branches or pull requests

8 participants