review: whole-repo round — relaxed snapshot touch, pidfd wait, dead Scan path, cloud-image sniff, FindVM reuse, comment budget - #208
Merged
Conversation
…es the kill(0) poll DataDir bumps LastAccessedAt on every clone-from-snapshot through a durable transaction (an fsync on sqlite, serialized on its single durable writer). The value only steers GC's LRU, so a lost touch costs one retention round; the touch commits relaxed now. terminateWithPidfd held a pidfd yet waited for exit by polling kill(pid, 0) every millisecond; it polls the fd itself, so the kernel wakes it on exit.
…lient record return Log.Scan's only production caller was metalog.Recorder.Scan, which no caller and no interface reaches. The OCI sizer's stat fallback served index entries older than v0.1.0. The Firecracker clone renamed cow.raw onto itself: runDir and COWRawPath derive from the same id and config. runningVMClientWithRecord's record was discarded at all three call sites.
…ad keeps the hypervisor; CNI seams; GC guards The Range probe fetched one byte, below the four-byte sniff floor, so a URL serving an HTML error page or a compressed payload was downloaded in full (up to 20 GiB) before nonImageSignatures rejected it. The probe now carries the first eight bytes and sniffs before downloadRangesParallel. A snapshot delete resumed from a tombstone emitted its storage-stop metering with an empty hypervisor; the payload records it. Prepare and the Add rollback bypassed three of the seven CNI test seams, and the test helper left statNetnsFn real, so Remove's TAP deletion had no coverage. gcTick ignores a nil GC hook; the bridge GC skips its link dump when it has nothing to match.
…--force scope, --from-dir positional
…aming helper, comment budget Eight verbs resolved a ref through FindHypervisor and immediately Inspected the same ref again; FindVM already returns the record. LogPath opened two views where ResolveAndLoad does one. vm list and vm status --watch reconciled each VM's state twice per render and the watch path never assigned it, so THROTTLED could contradict STATE. CNI interface names come from one helper and ifIndex rejects trailing garbage. Named scan-callback types replace three spelled-out func types. Comments shrink to the one-line budget; test files carry none; six godocs on interface-implementing methods go. ImageJSONNamespace is exported for cocoon-macos.
…vfio exports Generic tombstone recovery (gcRecover, DataDir) rolled an interrupted delete forward without closing the snapshot's metering interval; the recovery path now emits the stop with the hypervisor carried in the tombstone payload. ErrAlreadyRunning and NormalizePath stay exported for embedding callers.
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.
Whole-repo quality round (2026-09-03): every production file read against the /code Style Self-Check (8 readers) and the judgment lenses (engine, storage, host); five commits, net −197 lines, comment lines +22/−205.
DataDirbumpedLastAccessedAton every clone-from-snapshot through a durable transaction (an fsync on sqlite, serialized on the single durable writer); the value only steers GC's LRU, so the touch commits relaxed.terminateWithPidfdheld a pidfd but waited for exit by pollingkill(pid, 0)every millisecond; it polls the fd, so the kernel wakes it on exit (the VM stop path in everyvm rm/release).Log.Scanandmetalog.Recorder.Scanhad no caller anywhere in the workspace (the metering log was write-only); the OCI sizer's stat fallback served index entries older than v0.1.0; the Firecracker clone renamedcow.rawonto itself (runDirandCOWRawPathderive from the same id and config);runningVMClientWithRecord's record was discarded at all three call sites.nonImageSignaturesrejected it (perf(cloudimg): sniff before full download and reuse the non-Range probe response #137's Range half); a snapshot delete resumed from a tombstone emitted its storage-stop metering with an empty hypervisor;Prepareand the Add rollback bypassed three of the seven CNI test seams and the helper leftstatNetnsFnreal, soRemove's TAP deletion had no coverage on any platform;gcTickignores a nil GC hook; the bridge GC skips itsLinkListwhen it has no prefixes to match.nics=2/2log field it never emits; docs/vm.md named aREMOVEDevent verb (the code emitsDELETED) and the json engine's watch mechanism; docs/images.md and the flag help scoped--forceto URL pulls (OCI tags are re-resolved every pull); docs/cli.md's tree shows the--from-dirpositional.FindHypervisorand immediatelyInspected the same ref (the resolver's probe is that Inspect);FindVMreturns the record.LogPathopened two views whereResolveAndLoaddoes one.vm list/vm status --watchreconciled every VM's state twice per render and the watch path never assigned it, soTHROTTLEDcould contradictSTATE. CNI interface names come from one helper andifIndexrejects trailing garbage. Named scan-callback types replace three spelled-out func types. Comments shrink to the one-line budget; test files carry no comments (284 lines); six godocs on interface-implementing methods go.core.ImageJSONNamespaceis exported for cocoon-macos, which lostBaseConfig.JSONNamespacein cut: network Inspect/List and batch Delete, Reserver hard-require; images stop importing meta/json #207.Held with measurement or reason: the CNI Add's four
networks.jsonparses per run/clone (measured 0.1–1.0 % of a 230 ms copy-mode clone; both durable commits are required);deleteOneLockedre-walking/procper stopped VM (reusing the pre-stop scan contradicts the re-observe-under-lock rule at supervisor.go:83); theoci/cloudimgGC method pairs (a shared base costs more lines than it saves); unexporting ten package-private hypervisor helpers (surface only; the layout churn is not worth it); the vmlock 2 ms retry (the same cadence as gofrs/flock, no cancellable primitive).Gates:
GOWORK=off make lint0 issues on linux and darwin;make fmt-checkclean;asl ./...clean on both GOOS;GOWORK=off go test -race -count=1 ./...green (the Linux-gated CNI/bridge/pidfd paths run in CI). Round diff: 106 files, +269/−466.