When I issue docker stop <id>, the process doesn't exit cleanly and bitcoind has to roll-forward blocks on the next startup.

018-03-04 04:15:25 Rolling forward 0000000000000000001728efc81b210835048a7321ba3ec93197f698fac080ab (511863)
2018-03-04 04:15:26 Rolling forward 0000000000000000002be2e2792facd65e2358f874bc48f6410b80ecc8a6e756 (511864)
2018-03-04 04:15:26 Rolling forward 0000000000000000004740c4832b47a1c852db87cf4b9aea559db8712d2971a5 (511865)

This seems to be an issue with the dbcache not being written to disk prior to exit. I'm not sure if it's issuing a SIGTERM and then SIGKILL.

What is the best way to stop bitcoind to prevent any database related issues?

  • I found this to be very useful: ctl.io/developers/blog/post/…
    – relik
    Mar 4 '18 at 5:01
  • Welcome to Bitcoin.SE! You can help the site by marking answers as accepted if they are correct and address the question so that the question does not remain as "unanswered".
    – Willtech
    Mar 4 '18 at 6:52

Best way to stop bitcoind is either by calling the JSONRPC interface with the stop command or by issuing a SIGTERM or SIGHUP.

But it may take a couple of seconds to shut down Bitcoin Core since it eventually has to write larger amount of data (time depends on your dbcache, disk-speed, mempool size, etc.).

So the environment layer (docker in your case) must be capable to take this into account (a slow process shutdown).

  • 3
    Thanks! I think docker stop actually issues a SIGTERM, but it likely does a SIGKILL after 10 seconds, which could be the crux of the problem. Would love to vote you up, but i'm at 14 rep =\
    – relik
    Mar 4 '18 at 4:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.