Fail AppInitMain if either disk space check fails #15124

pull Empact wants to merge 1 commits into bitcoin:master from Empact:disk-space-check changing 1 files +7 −1
  1. Empact commented at 6:58 pm on January 7, 2019: member

    Rather than both.

    Introduced in 386a6b62a8a1db9dd0f354cb95b7585f555c7e5d, #12653

  2. Empact renamed this:
    Fail if either disk space check fails
    Fail AppInitMain if either disk space check fails
    on Jan 7, 2019
  3. promag commented at 11:23 pm on January 7, 2019: member
    I think it’s reasonable to split the expression to log which directory needs more space.
  4. jimpo commented at 2:18 am on January 8, 2019: contributor
    utACK 11e85ca
  5. in src/init.cpp:1634 in 11e85cab3c outdated
    1630@@ -1631,7 +1631,7 @@ bool AppInitMain(InitInterfaces& interfaces)
    1631 
    1632     // ********************************************************* Step 11: import blocks
    1633 
    1634-    if (!CheckDiskSpace() && !CheckDiskSpace(0, true))
    1635+    if (!CheckDiskSpace() || !CheckDiskSpace(0, true))
    


    MarcoFalke commented at 8:29 am on January 8, 2019:
    Could use named arguments for literals?

    Empact commented at 9:52 am on January 8, 2019:
    Done. #15118 clarifies these more so I’m partly deferring to that.
  6. MarcoFalke commented at 8:29 am on January 8, 2019: member
    utACK 11e85ca
  7. Empact force-pushed on Jan 8, 2019
  8. Empact force-pushed on Jan 8, 2019
  9. in src/init.cpp:1634 in 3a514fed17 outdated
    1630@@ -1631,7 +1631,7 @@ bool AppInitMain(InitInterfaces& interfaces)
    1631 
    1632     // ********************************************************* Step 11: import blocks
    1633 
    1634-    if (!CheckDiskSpace() && !CheckDiskSpace(0, true))
    1635+    if (!CheckDiskSpace() || !CheckDiskSpace(/* additional_bytes */ 0, /* blocks_dir */ true))
    


    laanwj commented at 1:48 pm on January 8, 2019:
    When you are changing this anyway: please provide explicit arguments to the first call too, instead of relying on default arguments
  10. jamesob commented at 7:30 pm on January 8, 2019: member
    Agree with @promag: while we’re in the neighborhood, we should specify which disk is full.
  11. Empact force-pushed on Jan 9, 2019
  12. Fail if either disk space check fails
    Rather than both.
    
    Introduced in 386a6b62a8a1db9dd0f354cb95b7585f555c7e5d
    ba8c8b2227
  13. Empact force-pushed on Jan 9, 2019
  14. Empact commented at 10:43 am on January 9, 2019: member
    Updated to address feedback.
  15. promag commented at 11:54 am on January 9, 2019: member
    utACK ba8c8b22, thanks!
  16. laanwj commented at 2:31 pm on January 9, 2019: member
    utACK ba8c8b22272ad40fe2de465d7e745532bab48d3b
  17. laanwj merged this on Jan 9, 2019
  18. laanwj closed this on Jan 9, 2019

  19. laanwj referenced this in commit 195d28fecb on Jan 9, 2019
  20. Empact deleted the branch on Jan 9, 2019
  21. MarcoFalke commented at 11:01 pm on January 9, 2019: member
    Could add a test, if possible somehow?
  22. Empact commented at 10:07 pm on January 10, 2019: member
    I don’t know of any way to set up the scenario as-is - could refactor for more testability with stubbing/mocking.
  23. random-zebra referenced this in commit edfaec63c2 on May 1, 2021
  24. PastaPastaPasta referenced this in commit c0fa59f214 on Jun 26, 2021
  25. PastaPastaPasta referenced this in commit 69dd85bd3d on Jun 28, 2021
  26. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 12:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me