fix(cli): recover stale rendezvous publication before declaring BUSY (#1760) - #1790
Open
umi008 wants to merge 1 commit into
Open
fix(cli): recover stale rendezvous publication before declaring BUSY (#1760)#1790umi008 wants to merge 1 commit into
umi008 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)