init: Remove boost from ThreadImport #18786

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2004-noBoostInitThreadImport changing 3 files +12 −6
  1. MarcoFalke commented at 7:36 PM on April 27, 2020: member

    Can be tested by calling -reindex or -loadblock and then pressing CTRL+C.

    Should print something like:

    ...
    2020-04-27T19:34:31Z [loadblk] Reindexing block file blk00005.dat...
    ^C2020-04-27T19:34:32Z [loadblk] Shutdown requested. Exit ThreadImport
    2020-04-27T19:34:32Z [qt-init] Interrupting HTTP server
    ...
    
  2. init: Remove boost from ThreadImport faec3dc2ad
  3. MarcoFalke added the label Refactoring on Apr 27, 2020
  4. MarcoFalke cross-referenced this on Apr 27, 2020 from issue Remove unused boost/thread by MarcoFalke
  5. DrahtBot commented at 11:04 PM on April 27, 2020: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #18758 (Remove unused boost/thread by MarcoFalke)

    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.

  6. practicalswift commented at 6:19 AM on April 28, 2020: contributor

    Concept ACK

  7. MarcoFalke commented at 12:32 PM on April 28, 2020: member

    Open-Close to re-run ci. See #15847 (comment)

  8. MarcoFalke closed this on Apr 28, 2020

  9. MarcoFalke reopened this on Apr 28, 2020

  10. MarcoFalke added this to the "In progress" column in a project

  11. in src/validation.cpp:4757 in faec3dc2ad
    4753 | @@ -4754,9 +4754,7 @@ bool LoadExternalBlockFile(const CChainParams& chainparams, FILE* fileIn, FlatFi
    4754 |      } catch (const std::runtime_error& e) {
    4755 |          AbortNode(std::string("System error: ") + e.what());
    4756 |      }
    4757 | -    if (nLoaded > 0)
    4758 | -        LogPrintf("Loaded %i blocks from external file in %dms\n", nLoaded, GetTimeMillis() - nStart);
    4759 | -    return nLoaded > 0;
    4760 | +    LogPrintf("Loaded %i blocks from external file in %dms\n", nLoaded, GetTimeMillis() - nStart);
    


    hebasto commented at 12:40 AM on May 2, 2020:

    This change adds log entry if nLoaded == 0. Is it intentional?


    MarcoFalke commented at 6:30 PM on May 2, 2020:

    Yes. LoadExternalBlockFile is only called when files are actually read. If nLoaded is zero, something has gone wrong and we should be verbose about that.

  12. hebasto commented at 12:48 AM on May 2, 2020: member

    Concept ACK.

  13. in src/init.cpp:733 in faec3dc2ad
     726 | @@ -723,6 +727,10 @@ static void ThreadImport(std::vector<fs::path> vImportFiles)
     727 |          if (file) {
     728 |              LogPrintf("Importing blocks file %s...\n", path.string());
     729 |              LoadExternalBlockFile(chainparams, file);
     730 | +            if (ShutdownRequested()) {
     731 | +                LogPrintf("Shutdown requested. Exit %s\n", __func__);
     732 | +                return;
     733 | +            }
    


    hebasto commented at 1:02 AM on May 2, 2020:

    Shouldn't this block be outside of the if ... else ... statement?


    MarcoFalke commented at 6:37 PM on May 2, 2020:

    why? That would be a slight behaviour change. Previously, we'd also loop over invalid files until the first valid file is found and then check for interruption. I don't think it matters much in any case.

  14. hebasto approved
  15. hebasto commented at 10:52 PM on May 2, 2020: member

    ACK faec3dc2adc487af97c22408f9f0bfe33f44a230, tested on Linux Mint 19.3 (x86_64) both bitcoind and bitcoin-qt binaries.

  16. laanwj commented at 1:41 PM on May 4, 2020: member

    Code review ACK faec3dc2adc487af97c22408f9f0bfe33f44a230

  17. laanwj merged this on May 4, 2020
  18. laanwj closed this on May 4, 2020

  19. MarcoFalke deleted the branch on May 4, 2020
  20. sidhujag referenced this in commit 9268ba58db on May 4, 2020
  21. MarcoFalke cross-referenced this on Jun 3, 2020 from issue validation: Make VerifyDB level 4 interruptible by MarcoFalke
  22. ComputerCraftr referenced this in commit 9758b7f4ad on Jun 16, 2020
  23. Fabcien referenced this in commit 521692129e on Jan 27, 2021
  24. fanquake moved this from the "In progress" to the "Done" column in a project

  25. kwvg referenced this in commit 05248a39b2 on Jul 13, 2021
  26. kwvg referenced this in commit b00ae0d272 on Jul 13, 2021
  27. kwvg referenced this in commit 5838603025 on Jul 13, 2021
  28. kwvg referenced this in commit cdf5504649 on Jul 13, 2021
  29. kwvg referenced this in commit 1e2bbca9c8 on Jul 15, 2021
  30. kwvg referenced this in commit efbc709745 on Jul 15, 2021
  31. kwvg referenced this in commit 88a646f3c0 on Jul 15, 2021
  32. kwvg referenced this in commit 9ae5a4c871 on Jul 16, 2021
  33. UdjinM6 referenced this in commit 730a89f8ed on Jul 16, 2021
  34. vijaydasmp referenced this in commit 8a669535a6 on Aug 23, 2021
  35. vijaydasmp cross-referenced this on Aug 27, 2021 from issue Backporting Merge #18786: init: Remove boost from ThreadImport by vijaydasmp
  36. Bushstar cross-referenced this on Sep 9, 2021 from issue Boost usage reduction by Bushstar
  37. Bushstar cross-referenced this on Sep 10, 2021 from issue C++17 and reduce Boost usage by Bushstar
  38. bitcoin locked this on Feb 15, 2022

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: 2026-05-20 06:54 UTC