connection: run async cleanups in LIFO not FIFO order #101

pull ryanofsky wants to merge 1 commits into bitcoin-core:master from ryanofsky:pr/lifo changing 1 files +25 −1
  1. ryanofsky commented at 1:03 PM on June 13, 2024: collaborator

    Run Connection class asynchronous cleanups in LIFO not FIFO order, which is more natural ordering and prevents a bitcoin wallet shutdown deadlock when the connection to the node process is broken. Also add comments better documenting cleanup order.

    This change fixes one of two shutdown deadlocks in the bitcoin wallet when the node process is killed in https://github.com/bitcoin/bitcoin/pull/10102 as of https://github.com/bitcoin/bitcoin/commit/3f12b4362c1b822835889151f6cd54c4829cf3ad. The other deadlock is caused by the ProxyServerCustom<WalletLoader> destructor in that PR and is described in commit efe42cc2879915b2ffdff04ec1cfe715e8dfa0a0 from #100.

    The bitcoin wallet shutdown deadlocks have probably been around for some time, but were not encountered because before https://github.com/bitcoin/bitcoin/commit/0b753156ce60c29efb2386954ba7555ad8f642f5 from https://github.com/bitcoin/bitcoin/pull/26606 there weren't any tests which killed the bitcoin node process and required the bitcoin-wallet process to shut down gracefully.

  2. connection: run async cleanups in LIFO not FIFO order
    Run Connection class asynchronous cleaups in LIFO not FIFO order, which is more
    natural ordering and prevents a bitcoin wallet shutdown deadlock when the
    connection to the node process is broken. Also add comments better documenting
    cleanup order.
    6825523c6e
  3. ryanofsky force-pushed on Jun 13, 2024
  4. ryanofsky commented at 3:48 PM on June 13, 2024: collaborator

    Updated cfdd85c6afab980f2730238d46e30d8fab8fad11 -> 6825523c6e35e6f8f56ff013d24b51d3ceb8f58d (pr/lifo.1 -> pr/lifo.2, compare) improving code comments

  5. ryanofsky merged this on Jun 13, 2024
  6. ryanofsky closed this on Jun 13, 2024

  7. ryanofsky referenced this in commit 3e6c61fdc2 on Jun 13, 2024
  8. ryanofsky commented at 9:26 PM on June 13, 2024: collaborator

    Deadlocks mentioned are described in more detail in https://github.com/bitcoin/bitcoin/pull/10102#issuecomment-2166556815

  9. ryanofsky referenced this in commit eecd63c8e2 on Jul 11, 2024
  10. ryanofsky referenced this in commit e58937ea45 on Jul 12, 2024
  11. ryanofsky referenced this in commit 48a2fc6fb1 on Jul 16, 2024
  12. ryanofsky referenced this in commit 8574f79db9 on Jul 16, 2024
  13. Sjors referenced this in commit c2dbbc5fb7 on Jul 17, 2024
  14. Sjors referenced this in commit fa0a0fa537 on Jul 17, 2024
  15. Sjors referenced this in commit 10100360b6 on Jul 18, 2024
  16. Sjors referenced this in commit 39c615dbdc on Jul 18, 2024
  17. ryanofsky referenced this in commit 33e86e04d1 on Jul 18, 2024
  18. ryanofsky referenced this in commit b3a5eb738f on Jul 18, 2024
  19. Sjors referenced this in commit 3cfcac15ba on Jul 19, 2024
  20. ryanofsky referenced this in commit 261395944e on Jul 24, 2024
  21. ryanofsky referenced this in commit c030548f20 on Jul 26, 2024
  22. ryanofsky referenced this in commit ebe93a5d0a on Sep 26, 2024
  23. bitcoin-core locked this on Jun 25, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/libmultiprocess. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-20 18:30 UTC

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