HomePhabricator

init: don't start indexes sync thread prematurely

Description

init: don't start indexes sync thread prematurely

Summary:
By moving the 'StartIndexes()' call into the 'initload'
thread, we can remove the threads active wait. Optimizing
the available resources.

The only difference with the current state is that now the
indexes threads will only be started when they can process
work and not before it.

This is a partial backport of core#27607
https://github.com/bitcoin/bitcoin/pull/27607/commits/fcbdaeef4d5a63e3e5b479c6fcad730eb86fb923

Depends on D17748

Notes:

  • we diverge from the source material in init.cpp because of missing backports (core#27861 and ancestors) that are intentionally skipped because they depend on the massive multiprocessing project. This affects a single line, and a TODO has been added to explain the divergence.
  • the test changes in feature_index_prune.py are applicable in the next commit, in this commit they would break the tests

Test Plan: ninja all check check-functional-extended

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D17749

Details

Provenance
furszy <matiasfurszyfer@protonmail.com>Authored on May 17 2023, 19:06
PiRKCommitted on Tue, Mar 4, 14:37
PiRKPushed on Tue, Mar 4, 14:37
Reviewer
Restricted Project
Differential Revision
D17749: init: don't start indexes sync thread prematurely
Parents
rABC8b333e573585: refactor: simplify pruning violation check
Branches
Unknown
Tags
Unknown