[Qt] Remove shutdown poll timer and replace it with a signal #10254

pull jonasschnelli wants to merge 3 commits into bitcoin:master from jonasschnelli:2017/04/qt_shutdown changing 4 files +15 −9
  1. jonasschnelli commented at 8:00 PM on April 21, 2017: contributor

    No description provided.

  2. Add ShutdownRequested signal 0c0aafe1a1
  3. [Qt] Replace shutdown detection poll timer with signal listener 9c74b5fe40
  4. jonasschnelli added the label GUI on Apr 21, 2017
  5. jonasschnelli requested review from laanwj on Apr 21, 2017
  6. jonasschnelli removed review request from laanwj on Apr 21, 2017
  7. laanwj commented at 7:46 AM on April 22, 2017: member

    I think we need to keep the polling-based path as well, to handle UNIX signals?

  8. Respect shutdown signal when handling SIGTERM 3a473402b1
  9. jonasschnelli commented at 8:00 AM on April 22, 2017: contributor

    I think we need to keep the polling-based path as well, to handle UNIX signals?

    Not sure. Just added a commit that calls StartShutdown() (instead of fRequestShutdown = true;). I guess this should work?

  10. in src/init.cpp:277 in 3a473402b1
     273 | @@ -273,7 +274,7 @@ void Shutdown()
     274 |   */
     275 |  static void HandleSIGTERM(int)
     276 |  {
     277 | -    fRequestShutdown = true;
     278 | +    StartShutdown();
    


    laanwj commented at 8:02 AM on April 22, 2017:

    This is not a good idea, UNIX signal handlers are extremely limited in what they can do. Basically:

    • Set atomic flags
    • Send to/receive from pipe

    This is why the polling was kept in #10125. It is there in addition to notification-based user initiated shutdown.

  11. jonasschnelli commented at 7:38 PM on April 22, 2017: contributor

    I wasn't aware of the async-signal-safe limitations. This seems indeed not simply solvable by a signal. Closing.

  12. jonasschnelli closed this on Apr 22, 2017

  13. DrahtBot locked this on Sep 8, 2021
Labels

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-21 18:15 UTC

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