This PR is a backport of #34804 to the 31.x branch. (Both PR’s point to the same source branch, they just have different target branches.) Some previous discussion about whether these changes should be merged into 31.x happened in https://github.com/bitcoin-core/libmultiprocess/pull/249#issuecomment-4118596442. The changes fix some IPC crashes that can happen with broken clients and unlucky thread timing that have only been seen in tests and antithesis runs, but the fixes are fairly simple and seem unlikely to cause new problems. The other changes in the PR are mostly CI/documentation/test changes and should also be safe.
Includes:
- https://github.com/bitcoin-core/libmultiprocess/pull/246
- https://github.com/bitcoin-core/libmultiprocess/pull/242
- https://github.com/bitcoin-core/libmultiprocess/pull/247
- https://github.com/bitcoin-core/libmultiprocess/pull/251
- https://github.com/bitcoin-core/libmultiprocess/pull/255
- https://github.com/bitcoin-core/libmultiprocess/pull/258
- https://github.com/bitcoin-core/libmultiprocess/pull/262
- https://github.com/bitcoin-core/libmultiprocess/pull/253
- https://github.com/bitcoin-core/libmultiprocess/pull/263
- https://github.com/bitcoin-core/libmultiprocess/pull/256
- https://github.com/bitcoin-core/libmultiprocess/pull/264
- https://github.com/bitcoin-core/libmultiprocess/pull/249
- https://github.com/bitcoin-core/libmultiprocess/pull/265
The main change is https://github.com/bitcoin-core/libmultiprocess/pull/249 which fixes 3 intermittent race conditions detected in bitcoin core CI and antithesis: #34711/#34756, #34777, and #34782.
The changes can be verified by running test/lint/git-subtree-check.sh src/ipc/libmultiprocess as described in developer notes and lint instructions