Adds a stopdetach <detach> RPC command. <detach> defaults to true. Wor... #1836

pull kjj2 wants to merge 1 commits into bitcoin:master from kjj2:stopdetach changing 1 files +8 −3
  1. kjj2 commented at 3:02 AM on September 19, 2012: none

    Adds a stopdetach <detach> RPC command. <detach> defaults to true.

    Works just like stop, but overrides the commandline/config file -detachdb option. Useful for upgrading, for example. Lets you use fast stops usually, but force a detach when needed. Also, allows you to do a fast stop in a system normally configured to detach.

  2. jgarzik commented at 3:19 AM on September 19, 2012: contributor

    Prefer "setdetach" to match the existing get/set naming scheme of RPC methods.

  3. kjj2 commented at 3:39 AM on September 19, 2012: none

    I thought about adding calls to get and set the state of the detach flag. In the end, it seemed a bit pointless. You really don't care about that flag except as your default (in the config file or start script) and when you are doing the actual stopping.

    (It occurs to me that it might not be clear that this actually performs the stop right away, just like the stop RPC call.)

    I did add a parameter to allow you to override the default in either direction, should someone ever need to, but I bet that about 95% of the use of this will be to force a full detach.

  4. jgarzik commented at 3:46 AM on September 19, 2012: contributor

    Since it combines the stop action, that's fair...

  5. laanwj commented at 6:48 AM on September 19, 2012: member

    What about adding an optional parameter to stop? I'd really like to have only one termination command.

    Edit: and as I understand, this will be temporary at most, because when we switch to leveldb there will be no detach flag anymore. I guess it is easier to ignore an argument than deprecate a command.

  6. BitcoinPullTester commented at 1:28 AM on September 20, 2012: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/c5daebeb753cdd0fe25db5bc9789ddb9ae442cff for binaries and test log.

  7. gavinandresen commented at 4:32 PM on September 20, 2012: contributor

    I like @laanwj 's suggestion, add an optional boolean param to stop.

  8. sipa commented at 12:31 PM on September 21, 2012: member

    Agree with @laanwj; in LevelDB we won't need this anymore.

  9. kjj2 commented at 6:14 PM on September 21, 2012: none

    Changed to an optional parameter to the stop RPC command. I also tested all 6 combinations of detachdb=0/1 and stop true/false/blank, and all worked as expected.

  10. gavinandresen commented at 8:04 PM on September 21, 2012: contributor

    ACK

  11. in src/bitcoinrpc.cpp:None in 6f8b9e8a63 outdated
     179 |          throw runtime_error(
     180 | -            "stop\n"
     181 | -            "Stop Bitcoin server.");
     182 | -    // Shutdown will take long enough that the response should get back
     183 | +            "stop <detach>\n"
     184 | +            "<detach> is true or false to detach or not for this stop only\n"
    


    laanwj commented at 9:23 AM on September 22, 2012:

    maybe clarify the message to "detach the database"

  12. BitcoinPullTester commented at 3:16 PM on September 22, 2012: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/6f8b9e8a6305018d0886584665d72de516d77025 for binaries and test log.

  13. Adds a stopdetach <detach> RPC command. <detach> defaults to true. Works just like stop, but overrides the commandline/config file
    -detachdb option.  Useful for upgrading, for example.  Lets you use fast stops usually, but force a detach when needed.  Also, allows
    you to do a fast stop in a system normally configured for fast stops.
    3731f5788e
  14. kjj2 commented at 11:23 PM on September 22, 2012: none

    Updated the help message, cleaned up spurious inserts/deletes

  15. laanwj referenced this in commit feec18e329 on Sep 23, 2012
  16. laanwj merged this on Sep 23, 2012
  17. laanwj closed this on Sep 23, 2012

  18. owlhooter referenced this in commit f71ab1daf6 on Oct 10, 2018
  19. DrahtBot locked this on Sep 8, 2021

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-19 15:15 UTC

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