-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Implement CCoinsViewErrorCatcher::HaveCoin and check disk space periodically
#26331
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
Implement CCoinsViewErrorCatcher::HaveCoin and check disk space periodically
#26331
Conversation
2c4d837 to
1527570
Compare
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsNo conflicts as of last run. |
1527570 to
ed52e71
Compare
w0xlt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review ACK ed52e71
sipa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK ed52e71
|
@willcl-ark you might have some thoughts on writing some sort of test for this? |
|
ACK ed52e71 |
… check disk space periodically ed52e71 Periodically check disk space to avoid corruption (Aurèle Oulès) 7fe537f Implement CCoinsViewErrorCatcher::HaveCoin (Aurèle Oulès) Pull request description: Attempt to fix bitcoin#26112. As suggested by sipa in bitcoin#26112 (comment): > CCoinsViewErrorCatcher, the wrapper class used around CCoinsViewDB that's supposed to detect these problems and forcefully exit the application, has an override for GetCoins. But in CheckTxInputs, HaveInputs is first invoked, which on its turn calls HaveCoin. HaveCoin is implemented in CCoinsViewDB, but not in CCoinsViewErrorCatcher, and thus the disk read exception escapes. > A solution may be to just add an override for HaveCoin in CCoinsViewErrorCatcher. I implemented `CCoinsViewErrorCatcher::HaveCoin` and also added a periodic disk space check that shutdowns the node if there is not enough space left on disk, the minimum here is 50MB. For reviewers, it's possible to saturate disk space to test the PR by creating large files with `fallocate -l 50G test.bin` ACKs for top commit: achow101: ACK ed52e71 w0xlt: Code Review ACK bitcoin@ed52e71 sipa: utACK ed52e71 Tree-SHA512: 456aa7b996023df42b4fbb5158ee429d9abf7374b7b1ec129b21aea1188ad19be8da4ae8e0edd90b85b7a3042b8e44e17d3742e33808a4234d5ddbe9bcef1b78
|
Post-merge concept ACK. Some kind of test coverage would be good. |
Attempt to fix #26112.
As suggested by sipa in #26112 (comment):
I implemented
CCoinsViewErrorCatcher::HaveCoinand also added a periodic disk space check that shutdowns the node if there is not enough space left on disk, the minimum here is 50MB.For reviewers, it's possible to saturate disk space to test the PR by creating large files with
fallocate -l 50G test.bin