Allow quicker shutdowns during LoadBlockIndex() #12980

pull jonasschnelli wants to merge 1 commits into bitcoin:master from jonasschnelli:2018/04/shutdown changing 3 files +3 −0
  1. jonasschnelli commented at 7:27 pm on April 13, 2018: contributor
  2. promag commented at 8:33 pm on April 13, 2018: member
    Concept ACK. Will review.
  3. in src/init.cpp:1452 in 404c7a10ff outdated
    1448@@ -1449,6 +1449,7 @@ bool AppInitMain()
    1449                 // Note that it also sets fReindex based on the disk flag!
    1450                 // From here on out fReindex and fReset mean something different!
    1451                 if (!LoadBlockIndex(chainparams)) {
    1452+                    if (fRequestShutdown) break;
    


    promag commented at 8:49 am on April 14, 2018:
    Also use ShutdownRequested()? I realize thatfRequestShutdown is used in src/init.cpp (the function is also used) but I wonder if using ShutdownRequested() should be used instead.

    promag commented at 9:31 am on May 3, 2018:
    Ping.
  4. promag commented at 8:53 am on April 14, 2018: member

    Same concept in #12448 and #12507.

    utACK 404c7a1.

  5. meshcollider added the label Refactoring on Apr 16, 2018
  6. jonasschnelli force-pushed on May 3, 2018
  7. jonasschnelli commented at 12:03 pm on May 3, 2018: contributor
    Fixed @promag’s finding.
  8. in src/init.cpp:1472 in 2b42793db4 outdated
    1448@@ -1449,6 +1449,7 @@ bool AppInitMain()
    1449                 // Note that it also sets fReindex based on the disk flag!
    1450                 // From here on out fReindex and fReset mean something different!
    1451                 if (!LoadBlockIndex(chainparams)) {
    1452+                    if (ShutdownRequested()) break;
    1453                     strLoadError = _("Error loading block database");
    


    promag commented at 12:08 pm on May 3, 2018:
    I’ll try to follow up a refactor here: this error should come from LoadBlockIndex and therefore the above condition is not necessary.
  9. promag commented at 12:09 pm on May 3, 2018: member
    utACK 2b42793.
  10. in src/txdb.cpp:258 in 2b42793db4 outdated
    267@@ -268,6 +268,7 @@ bool CBlockTreeDB::LoadBlockIndexGuts(const Consensus::Params& consensusParams,
    268     // Load mapBlockIndex
    269     while (pcursor->Valid()) {
    270         boost::this_thread::interruption_point();
    271+        if (ShutdownRequested()) return false;
    


    l2a5b1 commented at 12:48 pm on July 6, 2018:
    I would find it difficult to ACK this prior to #13235, because the use of ShutdownRequested would create a circular dependency between txdb and init.cpp where the ShutdownRequested function is implemented. Rebasing onto master solves this 😃.

    Empact commented at 4:00 am on July 9, 2018:
    IMO no need to rebase when the necessary change is in master as it will be brought in via the merge. Maybe just call out its relevance to the ack, as you have here.

    l2a5b1 commented at 7:27 am on July 9, 2018:
    You’re absolutely right: a rebase is not required to merge successfully. Good point, thanks!
  11. l2a5b1 commented at 1:02 pm on July 6, 2018: contributor
    utACK. Needs a rebase onto master because the function ShutdownRequested as used in txdb.cpp and validation.cpp has been isolated from init.cpp in #13235.
  12. Allow quicker shutdowns during LoadBlockIndex() af5fa82b67
  13. jonasschnelli force-pushed on Aug 2, 2018
  14. DrahtBot commented at 1:21 pm on September 21, 2018: member

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

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #13582 (Extract AppInitLoadBlockIndex from AppInitMain by Empact)

    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.

  15. DrahtBot closed this on Apr 28, 2019

  16. DrahtBot commented at 7:12 pm on April 28, 2019: member
  17. DrahtBot reopened this on Apr 28, 2019

  18. promag commented at 9:59 pm on May 18, 2019: member

    utACK af5fa82b676a36e60eda080ca0a946bdfffefd49.

    Anything against this change?

  19. practicalswift commented at 10:32 pm on May 18, 2019: contributor
    utACK af5fa82b676a36e60eda080ca0a946bdfffefd49
  20. jonasschnelli merged this on May 19, 2019
  21. jonasschnelli closed this on May 19, 2019

  22. jonasschnelli referenced this in commit 7110d455eb on May 19, 2019
  23. sidhujag referenced this in commit 5b2fbd6bf0 on May 20, 2019
  24. deadalnix referenced this in commit 54554de6b6 on Jun 11, 2020
  25. PastaPastaPasta referenced this in commit 53439a57b6 on Jun 27, 2021
  26. PastaPastaPasta referenced this in commit 963de0797a on Jun 28, 2021
  27. PastaPastaPasta referenced this in commit 7c77d2aeae on Jun 29, 2021
  28. PastaPastaPasta referenced this in commit 7d6d1bb095 on Jul 1, 2021
  29. PastaPastaPasta referenced this in commit 558a4cb1f4 on Jul 1, 2021
  30. PastaPastaPasta referenced this in commit 756af776fd on Jul 12, 2021
  31. 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-12-27 18:12 UTC

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