Default -rpcclienttimeout is too low for calls which cause rescan #9918

issue ian-kelling opened this issue on March 4, 2017
  1. ian-kelling commented at 1:30 PM on March 4, 2017: contributor

    Describe the issue

    Can you reliably reproduce the issue?

    Yes.

    If so, please list the steps to reproduce below:

    1. Using default options, with bitcoin-cli, call importprivkey (or I assume importaddress or importpubkey too).

    Expected behaviour

    Call should succeed.

    Actual behaviour

    bitcon-cli will timeout after 15 minutes, per default -rpcclienttimeout, exit with code 1. Bitcoind will complete the command in the background.

    What version of bitcoin-core are you using?

    58861ad9

    Machine specs:

    • OS: Debian stretch
    • CPU: i7-2600K CPU @ 3.40GHz
    • RAM: 16018 Mb
    • Disk Type (HD/SDD): HD

    Adjusting -rpcclienttimeout, the call takes 27 minutes on my machine.

    I can see 3 options for solving this:

    1. Increase the default -rpcclienttimeout. It appeared to be cpu bound. There are probably a not insignificant amount of people with slower cpus which take 1 hour or more. I can test on a raspberry pi. I assume the time is roughly linearly proportional to the blockchain size, which will double in 2 years time or so. So a default timeout which is expected to work for most people for a few years could be 3 hours or more. The timeout was last changed via commit 2190ea6c4e7f5 in September 2015, changing it from 30 seconds to 15 minutes.

    2. Increase the default -rpcclienttimeout only when a rescan is requested. I'm not sure if this is the only call which needs a higher timeout.

    3. Add a warning in the help output for calls which trigger a rescan about the default -rpcclienttimeout being too low.

  2. fanquake added the label RPC/REST/ZMQ on Mar 4, 2017
  3. laanwj commented at 10:11 PM on March 4, 2017: member

    All of those could work, though the ideal solution to this would be for commands like this to report back progress in some way, one way to do this would be through a chunked HTTP response. The timeout could then be reset each time progress updates come in.

  4. ian-kelling commented at 10:44 PM on March 4, 2017: contributor

    All of those could work, though the ideal solution to this would be for commands like this to report back progress in some way, one way to do this would be through a chunked HTTP response. The timeout could then be reset each time progress updates come in.

    Great idea.

  5. willcl-ark assigned pinheadmz on Apr 10, 2024
  6. willcl-ark commented at 3:54 PM on October 14, 2024: member

    Closing this as it has not had any activity in a while. If you are interested in continuing discussion on this, or you feel that it is sufficiently important, please leave a comment so that it can be reopened.

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

  8. maflcko commented at 9:51 AM on October 15, 2024: member

    3. Add a warning in the help output for calls which trigger a rescan about the default -rpcclienttimeout being too low.

    Seems like this could be an easy doc-only fix?

  9. bitcoin locked this on Oct 15, 2025

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-04-13 15:15 UTC

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