2 major findings · 1 suggestion
Earlier concerns neither republished nor resolved: 1 major finding · 1 minor finding. See the Run archive for their assessments.
Findings
[major] · Retained incoming connections prevent process exit
An accepted non-parent -ipcbind connection, even an idle one, remains alive after draining and prevents the IPC event loop from exiting, hanging process teardown.
Location: src/ipc/capnp/protocol.cpp:145 (head).
Details and suggested fix
disconnectIncoming() previously erased non-parent connections, but now only calls disconnect() and waits on their trackers. Transport teardown does not release each connection's EventLoopRef. It also expires m_alive, suppressing the remote-disconnect handler that would normally erase the connection, so closing the client later cannot recover. Consequently, ~CapnpProtocol() drops its own reference and blocks forever joining the loop thread. Collect the selected connection iterators in the first sync(), then erase those entries in a second sync() after draining, leaving the parent and any newly accepted connections untouched. Add a protocol-level test with an accepted idle client that checks teardown completes after disconnectIncoming().
[major] · Destroy cancellation can deadlock the IPC event loop
Cancellation of a local IPC destroy request can deadlock the shared event loop and prevent shutdown; no uninstrumented production occurrence has been observed.
Location: src/ipc/libmultiprocess/include/mp/proxy-io.h:874 (head).
Details and suggested fix
For a destroy request with mp.Context, such as BlockTemplate.destroy, the worker holds cancel_mutex through ServerDestroy::invoke(). The new invokeDestroy() then blocks in EventLoop::sync(). If cancellation or disconnect reaches the event loop after m_on_cancel is installed but before that sync callback executes, the loop blocks acquiring cancel_mutex, while the worker waits for the loop. This stalls all connections on that loop, including shutdown disconnection. Give ServerDestroy the same unlock, exception-safe relock, and cancellation check that ServerCall uses around invocation. A deterministic regression test should cancel a destroy after callback installation but before its sync callback runs.
Optional improvements
[suggestion] · Shutdown disconnection now reopens full IPC listeners
Local-disconnect cleanup now reopens at-capacity IPC listeners during shutdown, admitting connections outside the drain snapshot; no concrete harmful production call sequence has been established.
Location: src/ipc/libmultiprocess/include/mp/proxy-io.h:1095 (head).
Details and suggested fix
Moving the slot decrement to addSyncCleanup() correctly restores normal listener operation, but disconnectIncoming() also runs that cleanup. A listener at its configured limit, 16 connections by default, therefore resumes accepting while the original connections drain. Base's local erasure left such a listener closed; below-capacity admission was already possible. Connections accepted after the snapshot are never drained. Stop or gate listener admission before collecting trackers, while preserving slot release during normal operation. Fresh clients cannot obtain Mining after the shutdown signal because MakeMining() rejects them, but makeRpc() and RPC dispatch have no general shutdown gate, so that guard does not establish quiescence for all IPC services.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [major]: The parent connection is not covered by the shutdown drain
- [minor]: Reusing the Cap’n Proto checkout ignores the requested ref