ipc: stop listeners in CapnpProtocol::disconnectIncoming() #37009

pull mutatrum wants to merge 2 commits into bitcoin:master from mutatrum:fix/ipc-stop-listeners-36585 changing 5 files +132 −17
  1. mutatrum commented at 4:28 PM on November 29, 2026: contributor

    Related: #36585.

    Depends on bitcoin-core/libmultiprocess#403 (fixes bitcoin-core/libmultiprocess#385).

    Note: The first commit ([DO NOT MERGE]) temporarily mirrors the libmultiprocess PR in src/ipc/libmultiprocess/include/mp/proxy-io.h so CI can build and test this branch. It will be dropped once libmultiprocess merges and is subtree-synced.

    Motivation

    During Shutdown(), disconnectIncoming() closes existing IPC connections but leaves the listening socket open and present on disk. Auto-reconnecting IPC clients (such as mining clients like sv2-tp or ckpool) can reconnect in this window, acquiring a new EventLoopRef and causing ~CapnpProtocol() to hang indefinitely waiting for the reconnected client (#36585).

    Change

    src/ipc/capnp/protocol.cpp: Store the std::shared_ptr<mp::Listener> handles returned by mp::ListenConnections() in CapnpProtocol::m_listeners, and stop/clear them on m_loop->sync at the start of disconnectIncoming() (before removing existing m_incoming_connections) and in ~CapnpProtocol().

  2. DrahtBot added the label IPC on Nov 29, 2026
  3. DrahtBot commented at 4:28 PM on November 29, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

    LLM Linter (✨ experimental)

    Possible places where comparison-specific test macros should replace generic comparisons:

    • test/functional/interface_ipc.py: assert time.monotonic() < deadline → Prefer assert_greater_than(deadline, time.monotonic()).

    <sup>2026-11-29 22:31:44</sup>

  4. mutatrum force-pushed on Nov 29, 2026
  5. DrahtBot added the label CI failed on Nov 29, 2026
  6. DrahtBot commented at 5:33 PM on November 29, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task macOS native: https://github.com/bitcoin/bitcoin/actions/runs/46285602934/job/141417498195</sub> <sub>LLM reason (✨ experimental): functional_test_fail: The functional test interface_ipc_cli.py failed; the other listed tests passed or were skipped.</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • Intermittent network issues can occur; re-run CI for now, and report the issue if they keep happening.

    • A functional or integration test failure may be intermittent or unrelated to this pull request. If no dedicated issue thread exists, create a new one to track it.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  7. mutatrum force-pushed on Nov 29, 2026
  8. mutatrum renamed this:
    ipc: stop listeners and unlink unix sockets in disconnectIncoming()
    ipc: stop listeners in disconnectIncoming()
    on Nov 29, 2026
  9. mutatrum renamed this:
    ipc: stop listeners in disconnectIncoming()
    ipc: stop listeners in CapnpProtocol::disconnectIncoming()
    on Nov 29, 2026
  10. mutatrum force-pushed on Nov 29, 2026
  11. [DO NOT MERGE] subtree: preview libmultiprocess Listener::stop() 0a92983d26
  12. mutatrum force-pushed on Nov 29, 2026
  13. ipc: stop listeners in CapnpProtocol::disconnectIncoming() f384de3b4c
  14. mutatrum force-pushed on Nov 29, 2026

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-11-30 04:51 UTC

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