fix(sync): make the rclone probe timeout configurable (#137)#142
Merged
Conversation
The pre-unlock metadata probe (rclone lsjson) was bounded at a hardcoded 8s. A slow-but-alive remote on a high-latency backend would exceed that, be stamped as a failure, and enter the #133 failure-backoff — deferring pulls/pushes for the whole window even though the remote was reachable. Add sync.probe_timeout_seconds, mirroring the pull_ttl_seconds tri-state via a resolveProbeTimeout helper: - 0 -> built-in default (8s) - >0 -> that many seconds - <0 -> disable the bound (unbounded probe) Wired into the execExecutor built in NewService. Only the metadata probe (Run) is bounded; the heavy pull/push transfers (RunNoOutput) stay unbounded as before. Default is unchanged at 8s. Also documents both probe_timeout_seconds and the previously-undocumented pull_ttl_seconds in the configuration reference. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014kVLjbUL4F4CkoA7RbMYy8
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.
Closes #137. Follow-up from #133 (option 2).
Problem
The pre-unlock metadata probe (
rclone lsjson) is bounded at a hardcoded 8s (internal/sync/sync.go). #133 added a failure-backoff so a dead remote is probed at most once perpull_ttl_secondswindow — but a slow-but-alive remote is treated identically: a legitimate >8s probe times out, stampsLastPullFailure, and the backoff then defers pulls/pushes for the whole window even though the remote is reachable.Change
Add
sync.probe_timeout_seconds, mirroring the existingpull_ttl_secondstri-state via a smallresolveProbeTimeouthelper:0> 0< 0Wired into the
execExecutorconstructed inNewService. Only the metadata probe (Run) is bounded — the heavy pull/push transfers (RunNoOutput) stay unbounded, as the safety comment requires. Default stays 8s (kept conservative; the knob is the real fix).Docs
Added both
probe_timeout_secondsand the previously-undocumentedpull_ttl_secondsto the sync options table in the configuration reference, plus a CHANGELOG entry.Test
TestResolveProbeTimeout— 0 → default, positive → bound, negative → disabled.TestNewServiceWiresProbeTimeout— the value threads through toexecExecutor.runTimeout(white-box,package sync).go build✓ ·go vet✓ ·go test ./...✓ ·golangci-lint run→ 0 issues ✓🤖 Generated with Claude Code