Repository navigation
Adopt an own start job that settled before the first birth observation - #254
Merged
Merged
Conversation
The source VM and host Git units are Type=exec, so systemd completes the start job as soon as the stub's exec succeeds (median 16 ms, min 4.9 ms on the host). A starved owner could make its first observation after that, see the new invocation with no job attached and refuse birth. The start then stayed unsettled, stop refused before capture and Close required recovery forever. The job tracker now proves the missed correlation without waiting or consuming the result: our accepted job was removed with result done and no other job was removed on the unit since StartTransientUnit. systemd emits JobRemoved before it detaches the job and godbus delivers that signal ahead of any later reply, so a job-free observation follows every relevant signal. Without that proof, including a failed, unknown or foreign job, both owners refuse as before. Refs #174 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #174 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This was referenced Oct 23, 2026
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.
Fixes an intermittent start failure in the source VM owner and the host Git owner (#174).
Problem
captureBirthcorrelated a unit's first invocation with our start only if that invocation was observed while our accepted start job was still attached (git_vm_owner_linux.goandgit_early_stop_linux.go:if invocation == "" && before.Job.ID == 0 { refuse }). The units areType=exec, so systemd completes the start job as soon as the stub's exec succeeds: across 158 source starts in the journal, Starting → Started took a median of 16 ms and a minimum of 4.9 ms. In that window the owner (nice 10,GOMAXPROCS=2) writes the durableStartJobrecord and then observes the unit. Under CPU contention its first observation came after the job had finished; it refused, the start stayed unsettled,stoprefused atbefore-capture, andCloserefused with "source VM ownership requires recovery".Seen once in the aggregate E2E qualification (#251's
close-providerat 3133646: start not settled, invocation empty, the stub exiting after its 10 s grant wait) while another agent's race builds competed for CPU; an immediate rerun passed. The rule came in with #244 (source VM owner) and #226 (host Git owner).Fix
A job-free first sighting is accepted only when the job tracker proves that our own
StartJobwas removed with resultdoneand that no other job settled on that unit since ourStartTransientUnit; otherwise the start still fails closed. This rests on ordering checked in the sources: systemd 259job_uninstall()emitsJobRemovedbefore detaching the job from the unit, and godbus v5.1.0 delivers signals synchronously ahead of any later reply, so a later job-free observation follows every relevantJobRemoved. A replacement start by anyone else needs its own job, which is either still attached (path mismatch, refused) or recorded as foreign. The tracker gains aforeignmark and a non-consumingsettledcheck;WaitJobis unchanged. Both owners use the same proof.Evidence
TestGitVMOwnerStartAdoptsOwnJobSettledBeforeFirstObservation,TestGitVMOwnerUnbornStartedAttemptBlocksClose,TestSystemdJobSettledRequiresOwnDoneJobAndNoForeignJob,TestGitBirthStartAdoptsOwnJobSettledBeforeFirstObservation, and the reworkedTestGitBirthRejectsSettledJobBeforeAnyInvocationWasCorrelated(unproven, another job, foreign and failed jobs rejected; own done job accepted). All six accepting cases fail on the base; every rejecting case passes on both.StartTransientUnit: the base failed at stageunit-startwith the production signature; this branch passed and stopped the unit.go vet ./...andgo test -race ./...pass (reviewer package 236 s); new tests pass-race -count=20.GIT-UNIT.md,GIT-VM-SOURCE.mdandSYSTEMD-SUPERVISOR.mddescribe the rule.🤖 Generated with Claude Code