Repository navigation
feat(ci): check snapshots out in process groups of their own - #160
Open
PiquelChips wants to merge 1 commit into
Open
PiquelChips wants to merge 1 commit into
PiquelChips wants to merge 1 commit into
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 34 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
PiquelChips
force-pushed
the
feat/ci-checkouts
branch
from
November 22, 2026 15:04
d4f9a64 to
78abeab
Compare
PiquelChips
force-pushed
the
feat/ci-checkouts
branch
2 times, most recently
from
November 22, 2026 18:54
93d10d4 to
da512ca
Compare
Every check must run in a fresh checkout of the revision, so no check sees what another changed, and leave nothing running once it ends or its run is killed. `State` keeps what `origin-ci` needs for each repository, under `$XDG_STATE_HOME/origin-ci/<key>/`. `Snapshot` holds the trees and blobs a remote sent, and `State::checkout` writes them into a directory of its own, removed when dropped. `State::lock_worker` lets a single worker answer a repository's events. `Checkout::spawn` starts each command in a process group of its own, which inherits a locked `<n>.held` file, and `Checkout::stop` kills what is left of the group only while one of its processes still holds that lock: never another group that took its number since. A crashed run's checkout is swept, and its group stopped, by the next run. Where the platform can't tell which files a group holds, as on macOS, the group is leaked rather than risk killing someone else's.
PiquelChips
force-pushed
the
feat/ci-checkouts
branch
from
November 22, 2026 19:20
da512ca to
0fa32ce
Compare
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.
Every check must run in a fresh checkout of the revision, so no check sees what another changed. It must also leave nothing running once it ends or its run is killed.
Statekeeps whatorigin-cineeds per repository under$XDG_STATE_HOME/origin-ci/<key>/:Snapshotholds the trees and blobs the remote sent, andState::checkoutwrites them into a directory of its own, removed when dropped.Checkout::spawnstarts each command in a process group of its own, which inherits a locked<n>.heldfile.Checkout::stopkills what is left of the group, but only while one of its processes still holds that lock. A crashed run's checkout is swept, and its group killed, by the next run.State::lock_workermakes sure a single worker answers a repository's events.The sweep only kills a process group it can prove still holds its run's lock. On macOS no such proof is possible (
Processes::SEES_HELD_FILES), so it leaks the group rather than risk killing the wrong one.Known limitation: being in a group of its own, a check doesn't get the terminal's Ctrl-C. Interrupting
origin ci runleaves it to the next sweep.Note
Written by Claude Opus 5.5 in Claude Code (via T3 Code)