Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Add various code comments and documentation #100

Merged
merged 7 commits into from
Jun 13, 2024

Conversation

ryanofsky
Copy link
Collaborator

Add code comments and documentation. Most of these comments were originally added as part of #94 but are being moved to a separate PR so they can be merged sooner

Show how they are invoked by generated code
Add note about cleaning up custom state asynchronously, after a recently fixed
bug where there was a wallet deadlock when the node connection was broken,
caused by the ProxyServerCustom<WalletLoader> destructor trying to delete the
wallet CScheduler object synchronously (on the IPC EventLoop thread) while a
scheduled task was trying to make an Chain isReadyToBroadcast() IPC call.
@ryanofsky
Copy link
Collaborator Author

ryanofsky commented Jun 13, 2024

Updated efe42cc -> fce859d (pr/mdoc.1 -> pr/mdoc.2, compare) improving the documentation.
Updated fce859d -> 537c645 (pr/mdoc.2 -> pr/mdoc.3, compare) with more tweaks.

@ryanofsky ryanofsky merged commit 53ee9fa into chaincodelabs:master Jun 13, 2024
ryanofsky added a commit that referenced this pull request Jun 13, 2024
6825523 connection: run async cleanups in LIFO not FIFO order (Ryan Ofsky)

Pull request description:

  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 bitcoin/bitcoin#10102 as of bitcoin/bitcoin@3f12b43. The other deadlock is caused by the `ProxyServerCustom<WalletLoader>` destructor in that PR and is described in commit efe42cc from #100.

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

Top commit has no ACKs.

Tree-SHA512: cbbedcc71e4c3ebb541d95f2444151c4058fff3b6357bed5c1b2929d5311fd2a621aeed1af7f56a6159bb3c1ac8abf051acc22830f748edaa6b61ecd557f5074
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Jun 13, 2024
Fix "connection: run async cleanups in LIFO not FIFO order"
chaincodelabs/libmultiprocess#101 is needed to prevent
CI failure https://cirrus-ci.com/task/4549686449668096 caused by wallet
processes deadlocking during shutdown when node process is killed.

This also includes other recent changes:

chaincodelabs/libmultiprocess#95: cmake: Introduce `LibmultiprocessMacros` module
chaincodelabs/libmultiprocess#96: cmake: Introduce packages
chaincodelabs/libmultiprocess#97: cmake: rename new packages and module introduced in bitcoin#95 and bitcoin#96
chaincodelabs/libmultiprocess#98: cmake: Combine installed packages
chaincodelabs/libmultiprocess#99: proxy-types: Fix missing space in server destroy log print
chaincodelabs/libmultiprocess#100: doc: Add various code comments and documentation
chaincodelabs/libmultiprocess#102: doc: Document shutdown sequences better
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Jul 11, 2024
depends: Update libmultiprocess library

Fix "connection: run async cleanups in LIFO not FIFO order"
chaincodelabs/libmultiprocess#101 is needed to prevent
CI failure https://cirrus-ci.com/task/4549686449668096 caused by wallet
processes deadlocking during shutdown when node process is killed.

This also includes other recent changes:

chaincodelabs/libmultiprocess#95: cmake: Introduce `LibmultiprocessMacros` module
chaincodelabs/libmultiprocess#96: cmake: Introduce packages
chaincodelabs/libmultiprocess#97: cmake: rename new packages and module introduced in bitcoin#95 and bitcoin#96
chaincodelabs/libmultiprocess#98: cmake: Combine installed packages
chaincodelabs/libmultiprocess#99: proxy-types: Fix missing space in server destroy log print
chaincodelabs/libmultiprocess#100: doc: Add various code comments and documentation
chaincodelabs/libmultiprocess#102: doc: Document shutdown sequences better
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Jul 12, 2024
Fix "connection: run async cleanups in LIFO not FIFO order"
chaincodelabs/libmultiprocess#101 is needed to prevent
CI failure https://cirrus-ci.com/task/4549686449668096 caused by wallet
processes deadlocking during shutdown when node process is killed.

This also includes other recent changes:

chaincodelabs/libmultiprocess#95: cmake: Introduce `LibmultiprocessMacros` module
chaincodelabs/libmultiprocess#96: cmake: Introduce packages
chaincodelabs/libmultiprocess#97: cmake: rename new packages and module introduced in bitcoin#95 and bitcoin#96
chaincodelabs/libmultiprocess#98: cmake: Combine installed packages
chaincodelabs/libmultiprocess#99: proxy-types: Fix missing space in server destroy log print
chaincodelabs/libmultiprocess#100: doc: Add various code comments and documentation
chaincodelabs/libmultiprocess#102: doc: Document shutdown sequences better
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Jul 16, 2024
Fix "connection: run async cleanups in LIFO not FIFO order"
chaincodelabs/libmultiprocess#101 is needed to prevent
CI failure https://cirrus-ci.com/task/4549686449668096 caused by wallet
processes deadlocking during shutdown when node process is killed.

This also includes other recent changes:

chaincodelabs/libmultiprocess#95: cmake: Introduce `LibmultiprocessMacros` module
chaincodelabs/libmultiprocess#96: cmake: Introduce packages
chaincodelabs/libmultiprocess#97: cmake: rename new packages and module introduced in bitcoin#95 and bitcoin#96
chaincodelabs/libmultiprocess#98: cmake: Combine installed packages
chaincodelabs/libmultiprocess#99: proxy-types: Fix missing space in server destroy log print
chaincodelabs/libmultiprocess#100: doc: Add various code comments and documentation
chaincodelabs/libmultiprocess#102: doc: Document shutdown sequences better
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Jul 16, 2024
Fix "connection: run async cleanups in LIFO not FIFO order"
chaincodelabs/libmultiprocess#101 is needed to prevent
CI failure https://cirrus-ci.com/task/4549686449668096 caused by wallet
processes deadlocking during shutdown when node process is killed.

This also includes other recent changes:

chaincodelabs/libmultiprocess#95: cmake: Introduce `LibmultiprocessMacros` module
chaincodelabs/libmultiprocess#96: cmake: Introduce packages
chaincodelabs/libmultiprocess#97: cmake: rename new packages and module introduced in bitcoin#95 and bitcoin#96
chaincodelabs/libmultiprocess#98: cmake: Combine installed packages
chaincodelabs/libmultiprocess#99: proxy-types: Fix missing space in server destroy log print
chaincodelabs/libmultiprocess#100: doc: Add various code comments and documentation
chaincodelabs/libmultiprocess#102: doc: Document shutdown sequences better
Sjors pushed a commit to Sjors/bitcoin that referenced this pull request Jul 17, 2024
Fix "connection: run async cleanups in LIFO not FIFO order"
chaincodelabs/libmultiprocess#101 is needed to prevent
CI failure https://cirrus-ci.com/task/4549686449668096 caused by wallet
processes deadlocking during shutdown when node process is killed.

This also includes other recent changes:

chaincodelabs/libmultiprocess#95: cmake: Introduce `LibmultiprocessMacros` module
chaincodelabs/libmultiprocess#96: cmake: Introduce packages
chaincodelabs/libmultiprocess#97: cmake: rename new packages and module introduced in bitcoin#95 and bitcoin#96
chaincodelabs/libmultiprocess#98: cmake: Combine installed packages
chaincodelabs/libmultiprocess#99: proxy-types: Fix missing space in server destroy log print
chaincodelabs/libmultiprocess#100: doc: Add various code comments and documentation
chaincodelabs/libmultiprocess#102: doc: Document shutdown sequences better
Sjors pushed a commit to Sjors/bitcoin that referenced this pull request Jul 17, 2024
Fix "connection: run async cleanups in LIFO not FIFO order"
chaincodelabs/libmultiprocess#101 is needed to prevent
CI failure https://cirrus-ci.com/task/4549686449668096 caused by wallet
processes deadlocking during shutdown when node process is killed.

This also includes other recent changes:

chaincodelabs/libmultiprocess#95: cmake: Introduce `LibmultiprocessMacros` module
chaincodelabs/libmultiprocess#96: cmake: Introduce packages
chaincodelabs/libmultiprocess#97: cmake: rename new packages and module introduced in bitcoin#95 and bitcoin#96
chaincodelabs/libmultiprocess#98: cmake: Combine installed packages
chaincodelabs/libmultiprocess#99: proxy-types: Fix missing space in server destroy log print
chaincodelabs/libmultiprocess#100: doc: Add various code comments and documentation
chaincodelabs/libmultiprocess#102: doc: Document shutdown sequences better
Sjors pushed a commit to Sjors/bitcoin that referenced this pull request Jul 18, 2024
Fix "connection: run async cleanups in LIFO not FIFO order"
chaincodelabs/libmultiprocess#101 is needed to prevent
CI failure https://cirrus-ci.com/task/4549686449668096 caused by wallet
processes deadlocking during shutdown when node process is killed.

This also includes other recent changes:

chaincodelabs/libmultiprocess#95: cmake: Introduce `LibmultiprocessMacros` module
chaincodelabs/libmultiprocess#96: cmake: Introduce packages
chaincodelabs/libmultiprocess#97: cmake: rename new packages and module introduced in bitcoin#95 and bitcoin#96
chaincodelabs/libmultiprocess#98: cmake: Combine installed packages
chaincodelabs/libmultiprocess#99: proxy-types: Fix missing space in server destroy log print
chaincodelabs/libmultiprocess#100: doc: Add various code comments and documentation
chaincodelabs/libmultiprocess#102: doc: Document shutdown sequences better
Sjors pushed a commit to Sjors/bitcoin that referenced this pull request Jul 18, 2024
Fix "connection: run async cleanups in LIFO not FIFO order"
chaincodelabs/libmultiprocess#101 is needed to prevent
CI failure https://cirrus-ci.com/task/4549686449668096 caused by wallet
processes deadlocking during shutdown when node process is killed.

This also includes other recent changes:

chaincodelabs/libmultiprocess#95: cmake: Introduce `LibmultiprocessMacros` module
chaincodelabs/libmultiprocess#96: cmake: Introduce packages
chaincodelabs/libmultiprocess#97: cmake: rename new packages and module introduced in bitcoin#95 and bitcoin#96
chaincodelabs/libmultiprocess#98: cmake: Combine installed packages
chaincodelabs/libmultiprocess#99: proxy-types: Fix missing space in server destroy log print
chaincodelabs/libmultiprocess#100: doc: Add various code comments and documentation
chaincodelabs/libmultiprocess#102: doc: Document shutdown sequences better
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Jul 18, 2024
Fix "connection: run async cleanups in LIFO not FIFO order"
chaincodelabs/libmultiprocess#101 is needed to prevent
CI failure https://cirrus-ci.com/task/4549686449668096 caused by wallet
processes deadlocking during shutdown when node process is killed.

This also includes other recent changes:

chaincodelabs/libmultiprocess#95: cmake: Introduce `LibmultiprocessMacros` module
chaincodelabs/libmultiprocess#96: cmake: Introduce packages
chaincodelabs/libmultiprocess#97: cmake: rename new packages and module introduced in bitcoin#95 and bitcoin#96
chaincodelabs/libmultiprocess#98: cmake: Combine installed packages
chaincodelabs/libmultiprocess#99: proxy-types: Fix missing space in server destroy log print
chaincodelabs/libmultiprocess#100: doc: Add various code comments and documentation
chaincodelabs/libmultiprocess#102: doc: Document shutdown sequences better
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Jul 18, 2024
Fix "connection: run async cleanups in LIFO not FIFO order"
chaincodelabs/libmultiprocess#101 is needed to prevent
CI failure https://cirrus-ci.com/task/4549686449668096 caused by wallet
processes deadlocking during shutdown when node process is killed.

This also includes other recent changes:

chaincodelabs/libmultiprocess#95: cmake: Introduce `LibmultiprocessMacros` module
chaincodelabs/libmultiprocess#96: cmake: Introduce packages
chaincodelabs/libmultiprocess#97: cmake: rename new packages and module introduced in bitcoin#95 and bitcoin#96
chaincodelabs/libmultiprocess#98: cmake: Combine installed packages
chaincodelabs/libmultiprocess#99: proxy-types: Fix missing space in server destroy log print
chaincodelabs/libmultiprocess#100: doc: Add various code comments and documentation
chaincodelabs/libmultiprocess#102: doc: Document shutdown sequences better
Sjors pushed a commit to Sjors/bitcoin that referenced this pull request Jul 19, 2024
Fix "connection: run async cleanups in LIFO not FIFO order"
chaincodelabs/libmultiprocess#101 is needed to prevent
CI failure https://cirrus-ci.com/task/4549686449668096 caused by wallet
processes deadlocking during shutdown when node process is killed.

This also includes other recent changes:

chaincodelabs/libmultiprocess#95: cmake: Introduce `LibmultiprocessMacros` module
chaincodelabs/libmultiprocess#96: cmake: Introduce packages
chaincodelabs/libmultiprocess#97: cmake: rename new packages and module introduced in bitcoin#95 and bitcoin#96
chaincodelabs/libmultiprocess#98: cmake: Combine installed packages
chaincodelabs/libmultiprocess#99: proxy-types: Fix missing space in server destroy log print
chaincodelabs/libmultiprocess#100: doc: Add various code comments and documentation
chaincodelabs/libmultiprocess#102: doc: Document shutdown sequences better
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Jul 24, 2024
Fix "connection: run async cleanups in LIFO not FIFO order"
chaincodelabs/libmultiprocess#101 is needed to prevent
CI failure https://cirrus-ci.com/task/4549686449668096 caused by wallet
processes deadlocking during shutdown when node process is killed.

This also includes other recent changes:

chaincodelabs/libmultiprocess#95: cmake: Introduce `LibmultiprocessMacros` module
chaincodelabs/libmultiprocess#96: cmake: Introduce packages
chaincodelabs/libmultiprocess#97: cmake: rename new packages and module introduced in bitcoin#95 and bitcoin#96
chaincodelabs/libmultiprocess#98: cmake: Combine installed packages
chaincodelabs/libmultiprocess#99: proxy-types: Fix missing space in server destroy log print
chaincodelabs/libmultiprocess#100: doc: Add various code comments and documentation
chaincodelabs/libmultiprocess#102: doc: Document shutdown sequences better
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Jul 26, 2024
Fix "connection: run async cleanups in LIFO not FIFO order"
chaincodelabs/libmultiprocess#101 is needed to prevent
CI failure https://cirrus-ci.com/task/4549686449668096 caused by wallet
processes deadlocking during shutdown when node process is killed.

This also includes other recent changes:

chaincodelabs/libmultiprocess#95: cmake: Introduce `LibmultiprocessMacros` module
chaincodelabs/libmultiprocess#96: cmake: Introduce packages
chaincodelabs/libmultiprocess#97: cmake: rename new packages and module introduced in bitcoin#95 and bitcoin#96
chaincodelabs/libmultiprocess#98: cmake: Combine installed packages
chaincodelabs/libmultiprocess#99: proxy-types: Fix missing space in server destroy log print
chaincodelabs/libmultiprocess#100: doc: Add various code comments and documentation
chaincodelabs/libmultiprocess#102: doc: Document shutdown sequences better
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Sep 26, 2024
Fix "connection: run async cleanups in LIFO not FIFO order"
chaincodelabs/libmultiprocess#101 is needed to prevent
CI failure https://cirrus-ci.com/task/4549686449668096 caused by wallet
processes deadlocking during shutdown when node process is killed.

This also includes other recent changes:

chaincodelabs/libmultiprocess#95: cmake: Introduce `LibmultiprocessMacros` module
chaincodelabs/libmultiprocess#96: cmake: Introduce packages
chaincodelabs/libmultiprocess#97: cmake: rename new packages and module introduced in bitcoin#95 and bitcoin#96
chaincodelabs/libmultiprocess#98: cmake: Combine installed packages
chaincodelabs/libmultiprocess#99: proxy-types: Fix missing space in server destroy log print
chaincodelabs/libmultiprocess#100: doc: Add various code comments and documentation
chaincodelabs/libmultiprocess#102: doc: Document shutdown sequences better
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant