Skip to content

Conversation

@darosior
Copy link
Member

@darosior darosior commented Apr 18, 2019

As mentioned in #15813, there is a check for available disk space at startup in bitcoin-qt. This PR adds it to bitcoind too, at least for the first startup.

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK.

@jamesob
Copy link
Contributor

jamesob commented Apr 23, 2019

If this is actually something we want to do, we should also include a flag that disables this check since there are situations where users may want to run bitcoind without expecting to complete a full sync, e.g. when benchmarking.

@darosior darosior force-pushed the check_free_disk_size branch from 138bf9a to 1dd1289 Compare April 23, 2019 18:11
@darosior
Copy link
Member Author

darosior commented Apr 23, 2019

@promag I addressed the changes (renamed bytes_needed and check if height is <= 1 instead of 0), thank you for your review.
Edit: changed also the misleading comment in validation.h

@darosior
Copy link
Member Author

@jamesob could we make it an argument, like -dontcheckdiskpace ?

@maflcko
Copy link
Member

maflcko commented Apr 23, 2019

Does this work with reindex?

@darosior darosior force-pushed the check_free_disk_size branch from 9001b43 to 776f66b Compare April 23, 2019 18:59
@darosior
Copy link
Member Author

@MarcoFalke this caused a segfault with -reindex, I added a check for fReindex.

if (!CheckDiskSpace(GetDataDir())) {
InitError(strprintf(_("Error: Disk space is low for %s"), GetDataDir()));
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May as well leave this check out of the locked section, as it has no need for the related info.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the review. I tested outside of the lock and it makes bitcoind hanging forever on error.

@luke-jr
Copy link
Member

luke-jr commented May 1, 2019

IMO this is too much hand-holding for a server.

@darosior darosior changed the title Add a check for free disk space at first startup. ref #15813 Add a check for free disk space at first startup. May 2, 2019
@DrahtBot
Copy link
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #15340 (gui: Introduce bilingual GUI error messages by hebasto)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@darosior darosior closed this Jun 17, 2019
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants