Skip to content

fix(microvm): ignore transient Git maintenance lock in snapshots - #2614

Merged
jbeda merged 1 commit into
mainfrom
fix/microvm-maintenance-lock-flake
Oct 29, 2026
Merged

jbeda merged 1 commit into
mainfrom
fix/microvm-maintenance-lock-flake

Conversation

@jbeda

@jbeda jbeda commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Addresses #2327 item 4 only; the umbrella issue remains open.

  • Ignore only objects/maintenance.lock at the Git object-store root before opening an enumerated entry. Git may remove this transient artifact between ReadDir and open; it is not object data and should not be copied into the private snapshot.
  • Add a deterministic real-filesystem regression that enumerates an entry, deletes it, then invokes the production copy seam. Missing unrelated locks, nested maintenance.lock, loose objects, and pack files still return os.ErrNotExist.
  • Extend the packed-Git snapshot integration test to plant an extant maintenance lock and verify its omission while retaining packed-object reads, isolation, ownership preparation, and read-only object checks.

No retries, sleeps, timeout increases, fixture maintenance suppression, dependency changes, or unrelated flake fixes. Existing no-follow opens, alternates rejection, limits, and other error paths are unchanged.

Verification

Go 1.27.1, Linux amd64.

  • Both new positive assertions failed against the old production code: the vanished lock produced the historical open error, and an extant lock was incorrectly included in the snapshot.
  • Passed 50 repetitions with the race detector of the new stale-entry test, all object-snapshot tests, TestRepositoryRuntimeHostedSocketSuffix, and TestRepositoryRuntimeStartRejectsUnsafeObjectStoreBeforeBackend:
    cd environment/microvm
    GOWORK=off go test -race -count=50 -run '^(TestCopyObjectEntryVanishedAfterEnumeration|TestRepositoryObjectSnapshot.*|TestRepositoryRuntimeHostedSocketSuffix|TestRepositoryRuntimeStartRejectsUnsafeObjectStoreBeforeBackend)$' .
  • task --concurrency 3 test — passed (complete offline multi-module suite).
  • task lint — passed, zero issues in every module.
  • task --concurrency 3 test:race — passed (complete offline multi-module race suite).
  • go run ./cmd/mecademo — passed; verified tool calls, permission ask/approval, and final result.
  • task test:module-metadata — passed; module manifests and sums unchanged.
  • git diff --check — passed.

Full test suites have a 1,800-second outer timeout; lint/demo have 600-second outer timeouts. Local logs and panel report are retained under ignored .scratch/microvm-maintenance-lock/.

Review

Independent Spec, Standards, and Test-adequacy reviews plus security, architecture, library-reuse, and duplication specialists: no findings; all seven reviewers completed.

PANEL: ship_blockers=0 important=0 advisory=0 reviewer_failures=0

API compatibility

Backward-compatible internal bug fix: conforming clients need no changes. No wire fields, event semantics, API major, or feature identifiers change; no upgrade coordination is needed. No exported Go API or persisted-data schema changes. The transient Git maintenance lock is intentionally excluded from newly created private snapshots; real object-copy failures remain errors.

Skip only objects/maintenance.lock before opening enumerated object entries. Git may remove the lock between directory enumeration and open; it is not object data and must not be published in a private snapshot.

Add deterministic stale-entry coverage preserving errors for missing loose and packed objects, nested maintenance locks, and unrelated locks. Extend packed-Git snapshot coverage to prove an extant maintenance lock is omitted.

Refs #2327 (item 4 only).

Co-authored-by: Mecatl <[email protected]>
@jbeda
jbeda merged commit fb8c495 into main Oct 29, 2026
41 checks passed
@jbeda
jbeda deleted the fix/microvm-maintenance-lock-flake branch October 29, 2026 21:03
@jbeda jbeda mentioned this pull request Oct 29, 2026
10 of 14 tasks
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Nov 18, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants