Repository navigation
fix(processgroup): one undecidable group no longer hides the rest - #1236
Merged
Merged
Conversation
A registered group whose boot identity Core cannot decide (an older Darwin agent's clock-derived boot id) is rightly kept without signaling. But the preview aborted on the first such group, so `codefly clear --dry-run` listed nothing and stopped before counting sockets (cli#1233). The preview now names the group and its recovery (`codefly recover process-group PGID --preview`) and keeps listing; the stop path names it the same way; clear's dry run prints what it could list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review on #1236: a regression test for clear's dry-run output. With one group recorded by an older agent, the dry run logs the healthy group it would stop, warns about the kept group with its recovery command, counts the stale agent socket, returns the refusal, and signals nothing. It fails with either half of the fix reverted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Part A of #1233.
The problem. A registered process group whose boot identity Core can't decide (
checkBootIdentity: same leader PID and start, differentboot_id, which happens when an older Darwin agent recorded the clock-derivedkern.boottime) is rightly kept without signaling. But:PreviewManagedProcessGroupsaborted on the first such group and returned nothing. Socodefly clear --dry-runlisted no groups at all and stopped before counting stale sockets. That's what codefly run that fails or is stopped leaves docker containers and a native ClickHouse group holding ports; codefly clear refuses the group (0.1.222) #1233 shows:inspect registered group 95384: incompatible boot identity ….Fix
PreviewManagedProcessGroupskeeps going. A group whose ownership inspection fails, or isn't authenticated, is left out and named in the returned error with its recovery command (codefly recover process-group PGID --preview). Every other group is still listed. The error keeps itsinspect registered group <pgid>:prefix, whichTestReaperUsesOwnerInspectionForSupportedRecordsrelies on.reconcileRegisteredGroupnames the same recovery in its error. It already continued past a refused group.codefly clear --dry-runprints the groups it could list, warns about the kept ones, carries on to the socket count, and then returns the error.docs/orchestration.md: one sentence on how a kept group affects the others.Classification: fix at the owner. Core's refusal is unchanged: a group whose identity can't be decided is still never signaled. Reused: Core's
ListProcessGroups/InspectOwnership, and the existingcodefly recover process-groupworkflow. No new mechanism.Tests (written first)
TestAnUndecidableGroupIsKeptWithoutStoppingTheReststarts two real tracked groups in one workspace, then rewrites one record'sleaderandownerboot_idthe way an older writer left it.codefly recover process-group <pgid>.TestClearDryRunReportsPastAnUndecidableGroup(cmd) coversclear's dry-run output: two real tracked groups (one recorded as an older agent left it) and one stale agent socket, under a temporaryHOMEandTMPDIR. The dry run:codefly recover process-group <pgid>;It fails with either half of the fix reverted: with main's
cmd/clear.gonothing is logged, and with main'sregistered.goit logscount=0.Against main, it fails with #1233's exact error ("inspect registered group …: incompatible boot identity for unchanged process start …") and an empty preview.
Also run:
go test ./pkg/processgroup(all pass),go test ./cmd -run 'Clear|Recover',go vet, andgolangci-lint run ./pkg/processgroup/... ./cmd/...(0 issues).Not done here, and not verified
reconcileProcessGroupRegistriesstill returns after a failing registered pass, without running the legacy-records pass. That's harmless for codefly run that fails or is stopped leaves docker containers and a native ClickHouse group holding ports; codefly clear refuses the group (0.1.222) #1233, where the leftover is a current registration. I left it because I couldn't prove a change there with a test this size.🤖 Generated with Claude Code