-
Notifications
You must be signed in to change notification settings - Fork 20.5k
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
Crash on shutdown #27237
Comments
It is kind of hard to work around this. The naive way would be to just check The more robust approach is to fix the The third approach would be to check if upstream would be amenable to changing the behaviour. |
Ok, it wasn't that hard: #27238, I forgot that we already have a centralized accessor. Might have a bit of overhead though. |
One difference between pebble and leveldb is that the latter returns error when performing Get on a closed database, the former does a panic. This may be triggered during shutdown (see #27237) This PR changes the pebble driver so we check that the db is not closed already, for several operations. It also adds tests to the db test-suite, so the previously implicit assumption of "not panic:ing at ops on closed database" is covered by tests.
One difference between pebble and leveldb is that the latter returns error when performing Get on a closed database, the former does a panic. This may be triggered during shutdown (see ethereum#27237) This PR changes the pebble driver so we check that the db is not closed already, for several operations. It also adds tests to the db test-suite, so the previously implicit assumption of "not panic:ing at ops on closed database" is covered by tests.
Seen on a benchmarker during shutdown:
So the generator is running, and we shut down the blockchain (and thus the db too). I tried modifying
db get
so that it closes the db before doing theGet
.With leveldb:
WIth pebble:
So we previously were fine: doing a get on closed db returned an error, and we can handle that. Pebble throws a
panic
instead, which, although it cannot cause corruption of "main" database, it's obviously not great.The text was updated successfully, but these errors were encountered: