Skip to content

Conversation

@adityamaru
Copy link
Contributor

@adityamaru adityamaru commented Jan 31, 2026

Summary

  • Add timeouts to git mirror operations: refresh (2min), gc (60s), fsck (30s) using the timeout command for proper process termination
  • Reorder post step: refresh → GC → fsck (as final integrity gate) → unmount → commit
  • If any operation fails or times out, skip sticky disk commit to avoid persisting corrupted state
  • Report failures/timeouts as internal metrics to Blacksmith agent with reason tags

Testing

Deploy to Blacksmith VM and verify:

  • Metrics appear in Grafana with correct reason tags (failure vs timeout)
  • Sticky disk not committed when any operation times out or fails
  • Fsck detects and prevents commit of corrupted mirrors

🤖 Generated with Claude Code


Note

Medium Risk
Changes the post-step cache persistence decision and adds new time-bounded git operations (refresh/GC/fsck), which could alter when sticky disks are committed and impact cache availability if misclassified as failures/timeouts.

Overview
Adds bounded execution and structured result reporting for Blacksmith git-mirror maintenance: refreshMirror, mirror gc --auto, and new fsck now run via timeout with explicit success/timeout/failure results.

Reworks the post-step cleanup flow to treat refresh/GC/fsck issues as a hard gate (sets shouldCommit=false and clears vmHydratedGitMirror) before unmount/commit, and adds fire-and-forget internal metric reporting (git_mirror_refresh_failure, git_mirror_gc_failure, git_mirror_fsck_failure) tagged with reason (timeout vs failure).

Written by Cursor Bugbot for commit 13e7335. This will update automatically on new commits. Configure here.

adityamaru and others added 2 commits January 31, 2026 12:38
Wrap mirror refresh, GC, and fsck with timeouts (2min/60s/30s respectively) using the `timeout` command, which properly terminates child processes. If any operation fails or times out, skip sticky disk commit. Report failures/timeouts as internal metrics to Blacksmith agent. Ordering: refresh → GC → fsck (as final integrity gate) → unmount → commit.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@adityamaru adityamaru changed the title Add timeout and integrity checks to git mirror post step checkout: add timeout and integrity checks to git mirror post step Jan 31, 2026
getAuthConfigArgs calls new URL(repoUrl) which throws on malformed URLs.
Since refreshMirror's return type implies it won't throw, move this call
inside the existing try/catch so errors are captured in the OperationResult.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
If commitStickyDisk throws, cleanup() exited before returning the
result containing GC and fsck outcomes. This caused cleanupResult
in main.ts to remain undefined, silently skipping metric reporting
for GC/fsck failures.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

vmHydratedGitMirror was computed in main.ts before calling cleanup(),
so GC/fsck/refresh failures inside cleanup() would set shouldCommit=false
but leave vmHydratedGitMirror=true. This could cause the backend to mark
hydration as complete even though no valid disk was persisted.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@adityamaru adityamaru merged commit 5963d54 into main Feb 1, 2026
14 checks passed
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.

1 participant