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

Don't panic #212

Closed
erikgrinaker opened this issue Feb 23, 2020 · 2 comments
Closed

Don't panic #212

erikgrinaker opened this issue Feb 23, 2020 · 2 comments
Assignees
Labels
T:breaking Type: Breaking Change

Comments

@erikgrinaker
Copy link
Contributor

IAVL mostly uses panics for error handling. It should return errors instead.

@erikgrinaker erikgrinaker added the T:breaking Type: Breaking Change label Feb 23, 2020
@p4u
Copy link

p4u commented May 8, 2020

I am experiencing this issue. Instead of Panic IAVL should return errors in order to be able to handle them on the upper layer.

panic: Value missing for hash 5c762dd92f621bd3df4f93cdd153d5639590de63f8be117c317615faab68c0c6 corresponding to nodeKey n\v-�/b�O���S�c���c��|1v��h��

goroutine 1452118376 [running]:
github.com/tendermint/iavl.(*nodeDB).GetNode(0xc001fd0600, 0xc0724f3ea0, 0x20, 0x20, 0x0)
	/go/pkg/mod/github.com/tendermint/[email protected]/nodedb.go:109 +0x7bf
github.com/tendermint/iavl.(*Node).getRightNode(...)
	/go/pkg/mod/github.com/tendermint/[email protected]/node.go:417
github.com/tendermint/iavl.(*Node).get(0xc071dd45a0, 0xc0c6762b40, 0xc021c80c60, 0x81, 0x90, 0x81, 0xffffffffffffffff, 0xc0c934ad40, 0xc0475daff2)
	/go/pkg/mod/github.com/tendermint/[email protected]/node.go:174 +0x2f2
github.com/tendermint/iavl.(*Node).get(0xc071dd4500, 0xc0c6762b40, 0xc021c80c60, 0x81, 0x90, 0x81, 0x1, 0x1, 0x30ab980)
	/go/pkg/mod/github.com/tendermint/[email protected]/node.go:172 +0x1ac
github.com/tendermint/iavl.(*Node).get(0xc071c8bf40, 0xc0c6762b40, 0xc021c80c60, 0x81, 0x90, 0x81, 0xffffffffffffffff, 0xc017393410, 0xe8b266)
	/go/pkg/mod/github.com/tendermint/[email protected]/node.go:175 +0x26f
github.com/tendermint/iavl.(*Node).get(0xc071f69cc0, 0xc0c6762b40, 0xc021c80c60, 0x81, 0x90, 0x81, 0x1, 0xf, 0xc0054bea00)
	/go/pkg/mod/github.com/tendermint/[email protected]/node.go:172 +0x1ac
github.com/tendermint/iavl.(*Node).get(0xc071f69c20, 0xc0c6762b40, 0xc021c80c60, 0x81, 0x90, 0x90, 0x90, 0x81, 0xc021c80c60)
	/go/pkg/mod/github.com/tendermint/[email protected]/node.go:175 +0x26f
github.com/tendermint/iavl.(*ImmutableTree).Get(0xc0c6762b40, 0xc021c80c60, 0x81, 0x90, 0x81, 0x90, 0xc0173934a8, 0xf6cf71)
	/go/pkg/mod/github.com/tendermint/[email protected]/immutable_tree.go:157 +0x5a
gitlab.com/vocdoni/go-dvote/vochain.(*State).Envelope(0xc0341e7380, 0xc021c80bd0, 0x81, 0x1, 0x2, 0xc021c80bd0, 0x81)
	/src/vochain/iavl.go:477 +0xd3
gitlab.com/vocdoni/go-dvote/router.(*Router).getEnvelopeStatus(0xc0267c2690, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/src/router/voteCallbacks.go:98 +0x22c
created by gitlab.com/vocdoni/go-dvote/router.(*Router).Route
	/src/router/router.go:284 +0x429

@erikgrinaker erikgrinaker self-assigned this May 8, 2020
@alexanderbez
Copy link
Contributor

alexanderbez commented May 8, 2020

Very much in favor of this, especially since this is a library.

p4u pushed a commit to vocdoni/vocdoni-node that referenced this issue May 15, 2020
We've seen a handful of panics from iavl in Envelope and EnvelopeList
calls.

Until cosmos/iavl#212 is fixed by
upstream, try to return or log an error instead of crashing the entire
gateway.

We shouldn't see these panics anymore after we fixed the data races in
the previous commit. Still, be extra safe.

For #262.
@tac0turtle tac0turtle added this to the 0.14.0 milestone May 20, 2020
@erikgrinaker erikgrinaker removed their assignment Feb 5, 2021
@tac0turtle tac0turtle removed this from the 0.15.0 milestone May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T:breaking Type: Breaking Change
Projects
Archived in project
Development

No branches or pull requests

5 participants