Skip to content

Conversation

@laanwj
Copy link
Member

@laanwj laanwj commented Apr 6, 2016

Two-line patch to make it possible to shut down bitcoind cleanly during the initial ActivateBestChain.

Fixes #6459 (among other complaints).

To reproduce:

  • shutdown bitcoind
  • copy chainstate
  • start bitcoind
  • let the chain sync a bit
  • shutdown bitcoind
  • copy back old chainstate
  • start bitcoind
  • bitcoind will catch up with all blocks during Init(), this can take a long time

(the boost::this_thread::interruption_point / ShutdownRequested() dance is ugly, this should be refactored all over bitcoind at some point when moving from boost::threads to c++11 threads, but it works...)

Two-line patch to make it possible to shut down bitcoind cleanly during
the initial ActivateBestChain.

Fixes bitcoin#6459 (among other complaints).

To reproduce:

- shutdown bitcoind
- copy chainstate
- start bitcoind
- let the chain sync a bit
- shutdown bitcoind
- copy back old chainstate
- start bitcoind
- bitcoind will catch up with all blocks during Init()

(the `boost::this_thread::interruption_point` / `ShutdownRequested()`
dance is ugly, this should be refactored all over bitcoind at some point
when moving from boost::threads to c++11 threads, but it works...)
@jonasschnelli
Copy link
Contributor

utACK 07398e8

@dcousens
Copy link
Contributor

dcousens commented Apr 7, 2016

concept ACK, utACK 07398e8

@sipa
Copy link
Member

sipa commented Apr 7, 2016

utACK 07398e8

@laanwj laanwj merged commit 07398e8 into bitcoin:master Apr 7, 2016
laanwj added a commit that referenced this pull request Apr 7, 2016
07398e8 init: allow shutdown during 'Activating best chain...' (Wladimir J. van der Laan)
laanwj added a commit that referenced this pull request Apr 7, 2016
Two-line patch to make it possible to shut down bitcoind cleanly during
the initial ActivateBestChain.

Fixes #6459 (among other complaints).

To reproduce:

- shutdown bitcoind
- copy chainstate
- start bitcoind
- let the chain sync a bit
- shutdown bitcoind
- copy back old chainstate
- start bitcoind
- bitcoind will catch up with all blocks during Init()

(the `boost::this_thread::interruption_point` / `ShutdownRequested()`
dance is ugly, this should be refactored all over bitcoind at some point
when moving from boost::threads to c++11 threads, but it works...)

Github-Pull: #7821
Rebased-From: 07398e8
@sipa sipa mentioned this pull request Apr 20, 2016
1 task
zander pushed a commit to bitcoinclassic/bitcoinclassic that referenced this pull request Apr 22, 2016
Two-line patch to make it possible to shut down bitcoind cleanly during
the initial ActivateBestChain.

Fixes bitcoin#6459 (among other complaints).

To reproduce:

- shutdown bitcoind
- copy chainstate
- start bitcoind
- let the chain sync a bit
- shutdown bitcoind
- copy back old chainstate
- start bitcoind
- bitcoind will catch up with all blocks during Init()

(the `boost::this_thread::interruption_point` / `ShutdownRequested()`
dance is ugly, this should be refactored all over bitcoind at some point
when moving from boost::threads to c++11 threads, but it works...)

Github-Pull: bitcoin#7821
Rebased-From: 07398e8
thokon00 pushed a commit to faircoin/faircoin that referenced this pull request Jun 28, 2016
Two-line patch to make it possible to shut down bitcoind cleanly during
the initial ActivateBestChain.

Fixes bitcoin#6459 (among other complaints).

To reproduce:

- shutdown bitcoind
- copy chainstate
- start bitcoind
- let the chain sync a bit
- shutdown bitcoind
- copy back old chainstate
- start bitcoind
- bitcoind will catch up with all blocks during Init()

(the `boost::this_thread::interruption_point` / `ShutdownRequested()`
dance is ugly, this should be refactored all over bitcoind at some point
when moving from boost::threads to c++11 threads, but it works...)

Github-Pull: bitcoin#7821
Rebased-From: 07398e8
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v0.11.0 - Activating best chain... - kill -9

4 participants