mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:29:40 +00:00
WIP: ipc: stop listeners in CapnpProtocol::disconnectIncoming() #37009
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!37009
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/ipc-stop-listeners-36585"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Related: #36585.
Depends on bitcoin-core/libmultiprocess#403 (fixes bitcoin-core/libmultiprocess#385).
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 likesv2-tporckpool) can reconnect in this window, acquiring a newEventLoopRefand causing~CapnpProtocol()to hang indefinitely waiting for the reconnected client (#36585).Change
src/ipc/capnp/protocol.cpp: Store thestd::shared_ptr<mp::Listener>handles returned bymp::ListenConnections()inCapnpProtocol::m_listeners, and stop/clear them onm_loop->syncat the start ofdisconnectIncoming()(before removing existingm_incoming_connections) and in~CapnpProtocol().The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
A summary of reviews will appear here.
Conflicts
Reviewers, this pull request conflicts with the following ones:
CapnpProtocolby nullfail)If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
🔵 Suggestion · Reconnect test can pass without checking the listener stop in
disconnectIncoming()The reconnect assertion can pass after later teardown closes the socket, without verifying that
disconnectIncoming()stopped listening.Location:
test/functional/interface_ipc.py:214(head).🔵 Suggestion · Listener tests miss explicit stop and retained-handle cancellation
Dedicated listener tests cover pause/resume but not explicit
stop(), repeated stops, or loop cancellation while a caller retains the handle.Location:
src/ipc/libmultiprocess/include/mp/proxy-io.h:993(head).Reviewed:
50f952f9af3e· Review report · Previous reportspermalink
🚧 At least one of the CI tasks failed.
Task
macOS native: https://github.com/bitcoin/bitcoin/actions/runs/46285602934/job/141417498195LLM reason (✨ experimental): functional_test_fail: The functional test
interface_ipc_cli.pyfailed; the other listed tests passed or were skipped.Hints
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.