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

Stop uses of database before closing db. #87

Merged
merged 1 commit into from
Mar 3, 2016

Conversation

jrick
Copy link
Member

@jrick jrick commented Mar 3, 2016

Since the stop RPC and ^C interrupt handling now shutdown the process
using the same code path, the closeDB callback needs to stop any
remaining uses of the database before closing the DB.

This should prevent any database corruption issues that may happen
during clean shutdown, but unclean shutdown can still corrupt the
database since not all operations that should be atomic actually are.

Since the stop RPC and ^C interrupt handling now shutdown the process
using the same code path, the closeDB callback needs to stop any
remaining uses of the database before closing the DB.

This should prevent any database corruption issues that may happen
during clean shutdown, but unclean shutdown can still corrupt the
database since not all operations that should be atomic actually are.
@jcvernaleo
Copy link
Member

Looks good and works in my testing (although I haven't actually hit corruption on shutdown even when abrupt in a long time). I don't see the panics I would sometimes see on ^C though (although that wasn't every time and absence of evidence and all that....)
OK

@jcvernaleo jcvernaleo merged commit 9c9699f into decred:master Mar 3, 2016
@jrick jrick deleted the cleandbshutdown branch March 11, 2016 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants