fix(cli): recover stale rendezvous publication before declaring BUSY (#1760) - #1790
fix(cli): recover stale rendezvous publication before declaring BUSY (#1760)#1790umi008 wants to merge 1 commit into
Conversation
After a hard-killed daemon, the runtime dir keeps the socket/anchor/ identity publication while every lock is kernel-released. The CLI activation guard probed generation and treated the ECONNREFUSED socket as an active daemon (fail-closed, intentional for saturated listeners), so install/update failed forever with 'active CBM sessions ... could not be stopped safely' even though nothing was running — a deadlock by residue, since only daemon-start paths ran the stale cleanup. cli_activation_production_reserve now recognizes the provably-stale combination — generation present with no lifetime reservation, under the startup lock it already holds — and runs the existing cbm_daemon_ipc_stale_generation_cleanup repair, then re-probes before deciding. Stale cleanup re-checks both conditions and refuses on a genuinely held reservation, so a live daemon (including a saturated BSD listener) is never disturbed: the guard falls back to the original BUSY verdict. POSIX-only; Windows semantics are unchanged. Fixes DeusData#1760 Signed-off-by: Ulises Millan Guerrero <ulises.millanguerrero@gmail.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Thank you for the detailed stale-residue analysis and for reusing the existing guarded cleanup path. I checked current There is one factual contribution-policy blocker before code review. This focused fix also adds 131 lines under five new |
What does this PR do?
After CBM processes are hard-killed (
pkill/kill -9), the runtime dir keeps the published socket/anchor/identity files while every file lock is kernel-released. The CLI activation guard probed generation and treated theECONNREFUSEDsocket as an active daemon — a deliberate fail-closed choice that protects saturated BSD listeners — soinstall/updatefailed forever with "active CBM sessions ... could not be stopped safely" even though nothing was running. Only daemon-start paths ran the stale cleanup, which the CLI could never reach: deadlock by residue.cli_activation_production_reservenow recognizes the provably-stale combination — generation present, lifetime reservation absent, startup lock already held — and runs the existingcbm_daemon_ipc_stale_generation_cleanuprepair, then re-probes generation before deciding. The cleanup re-checks both conditions and refuses on a genuinely held reservation, so a live daemon (including a saturated BSD listener) is never disturbed and the guard falls back to the original BUSY verdict. POSIX-only; Windows keeps its rendezvous-record semantics unchanged.Verified with an end-to-end regression test: a child listens and exits without unlink (hard-kill residue), then the real activation guard installs successfully, removes the residue, and records the
completedphase.Checklist
git commit -s) — required, CI rejects unsigned commits (DCO, see CONTRIBUTING.md)make -f Makefile.cbm test)make -f Makefile.cbm lint-ci)