Skip to content

fix(mount): stop repeated stalled bootstrap checkpoints#361

Merged
miyaontherelay merged 2 commits into
mainfrom
fix/bootstrap-empty-revision-360
Jul 18, 2026
Merged

fix(mount): stop repeated stalled bootstrap checkpoints#361
miyaontherelay merged 2 commits into
mainfrom
fix/bootstrap-empty-revision-360

Conversation

@miyaontherelay

Copy link
Copy Markdown
Contributor

Fixes #360.\n\nAdds a persisted bootstrap checkpoint stall guard (default 20, configurable with RELAYFILE_BOOTSTRAP_STALL_CYCLES), surfaces a typed hard failure, and stops the mount polling runner when that failure recurs.\n\nCoverage includes partial unversioned tree checkpoints, persistence/reset behavior, delete safety, normal retry behavior, and the timer-path runner exit.\n\nValidation: go test ./... -count=1; go vet ./...; git diff --check.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@miyaontherelay, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f7abf5b7-a067-4afa-a4a1-4e3c03203055

📥 Commits

Reviewing files that changed from the base of the PR and between ddf5c95 and d8a23d8.

📒 Files selected for processing (2)
  • internal/mountsync/bootstrap_test.go
  • internal/mountsync/syncer.go
📝 Walkthrough

Walkthrough

The mount syncer now tracks unchanged bootstrap checkpoints, raises a typed error at a configurable stall limit, persists terminal state, and resets counters when progress or completion occurs. Polling mounts terminate on this error while continuing to suppress ordinary cycle failures.

Changes

Bootstrap stall guard

Layer / File(s) Summary
Stall configuration and error contracts
internal/mountsync/syncer.go
Adds configurable stall limits, persisted counters, BootstrapStalledError, and dedicated status classification.
Checkpoint stall detection and state resets
internal/mountsync/syncer.go, internal/mountsync/*_test.go
Compares bootstrap checkpoints, records stall cycles, persists terminal failures, resets state on progress or mode transitions, and tests resolution and reset behavior.
Polling termination and behavioral coverage
cmd/relayfile-mount/*, internal/mountsync/tombstones_test.go
Propagates bootstrap stall errors from initial and scheduled reconciles while preserving nonfatal handling for ordinary failures, with polling and revision-gate tests.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PollingMount
  participant Syncer
  participant RemoteServer
  participant StateFile
  PollingMount->>Syncer: run reconcile
  Syncer->>RemoteServer: pull bootstrap page
  RemoteServer-->>Syncer: page or failure
  Syncer->>StateFile: compare and persist checkpoint
  StateFile-->>Syncer: stall count
  Syncer-->>PollingMount: continue or BootstrapStalledError
  PollingMount-->>PollingMount: terminate on typed error
Loading

Possibly related PRs

Suggested reviewers: khaliqgant, kjgbot

Poem

I’m a rabbit guarding the tree,
Counting stalled hops patiently.
When the cursor will not move,
I thump and stop the polling groove.
Progress resets my little chart—
Then springtime syncs can safely start.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR adds a stall guard and hard stop, but the linked issue also calls for empty-revision convergence and write-only mounts skipping remote reconciliation. Add handling for empty or absent observed revisions as a valid initial revision and ensure write-only mounts do not reconcile the remote tree.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately describes the main change: stopping repeated stalled bootstrap checkpoints.
Description check ✅ Passed The description matches the implemented bootstrap stall guard, hard failure, and polling-runner exit behavior.
Out of Scope Changes check ✅ Passed The changes stay within the bootstrap-stall fix and its related test coverage, with no clear unrelated features.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/bootstrap-empty-revision-360

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown

Relayfile Eval Review

Run: .relayfile/evals/runs/2026-07-18T20-55-06-908Z-HEAD-provider
Mode: provider
Git SHA: 4964808

Passed: 4 | Needs human: 0 | Reviewable: 0 | Missing output: 0 | Failed: 0 | Skipped: 0

Human Review Cases

No reviewable human-review cases captured Relayfile output.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/mountsync/syncer.go`:
- Around line 4582-4587: Update recordBootstrapCycle to leave
BootstrapStallCycles unchanged when cause is or wraps context.Canceled and there
is no checkpoint advancement, while preserving the existing reset behavior and
continuing to count context.DeadlineExceeded and other errors.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 46d83347-ad0b-4598-a13e-fc5e061c70bf

📥 Commits

Reviewing files that changed from the base of the PR and between a030c75 and ddf5c95.

📒 Files selected for processing (6)
  • cmd/relayfile-mount/main.go
  • cmd/relayfile-mount/main_test.go
  • internal/mountsync/bootstrap_test.go
  • internal/mountsync/syncer.go
  • internal/mountsync/syncer_test.go
  • internal/mountsync/tombstones_test.go

Comment thread internal/mountsync/syncer.go
@miyaontherelay
miyaontherelay merged commit e50bff8 into main Jul 18, 2026
10 checks passed
@miyaontherelay
miyaontherelay deleted the fix/bootstrap-empty-revision-360 branch July 18, 2026 20:57
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.

relayfile-mount bootstrap never converges: empty observed revision loops "forcing full reconcile" forever, blocking the agent run

1 participant