Support for non-immediate periodic tasks with variable runtime #18488

issue naumenkogs openend this issue on April 1, 2020
  1. naumenkogs commented at 0:10 am on April 1, 2020: member

    We currently have several threads in Bitcoin Core, and one of them is the scheduler. This scheduler takes care of DumpAddresses, MaybeResendWalletTxs, MaybeCompactWalletDB, CheckForStaleTipAndEvictPeers and ValidationInterface. It’s good idea to have a scheduler because it allows to avoid the memory overhead caused by having a dedicated thread per task.

    It is currently unclear what are the expectations of the tasks the scheduler takes care of. For example, if there’s a way to externally fill the queue for seconds, one could influence wallet rebroadcast timings and deanonymize those transactions.

    One issue I personally faced is integrating periodic DNS caches updates, a task which sometimes might take more than a minute, and there seem to be no trivial way to bound the runtime.

    One way to make it work, and to make the time bound expectations more explicit: add a separate scheduler to take care of all non-immediate tasks, which may take longer than 5 seconds.

    Besides DNS cache updates, this may be relevant to other features in the future, or allow making the existent features heavier. We can also move DumpAddresses there: it can’t be time-analyzed, but can possibly take long (if I/O is slow and a lot of entries), and is fine with waiting an extra minute. I believe it can also be relevant for the utxo snapshot creation from assumeutxo project?

    Alternatively, we expand the existing single scheduler with a functionality which allows to set an upper bound on the runtime of tasks it executes, and/or switch between tasks (I don’t know how yet, but that should be doable).

    I’m interested in your opinions!

  2. naumenkogs added the label Feature on Apr 1, 2020
  3. maflcko removed the label Feature on Apr 1, 2020
  4. maflcko added the label Brainstorming on Apr 1, 2020
  5. ariard referenced this in commit 371759185c on May 12, 2020
  6. willcl-ark commented at 2:46 pm on October 14, 2024: member

    This feature request does not seem to have attracted much attention from other contributors. As such, it does not seem important enough to keep it sitting around idle in the list of open issues. Closing due to lack of interest.

    Pull requests with improvements are always welcome.

  7. willcl-ark closed this on Oct 14, 2024


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-10-30 00:12 UTC

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