Skip to content

fix(sync): make the rclone probe timeout configurable (#137)#142

Merged
arimxyer merged 1 commit into
mainfrom
fix/137-configurable-probe-timeout
Jul 1, 2026
Merged

fix(sync): make the rclone probe timeout configurable (#137)#142
arimxyer merged 1 commit into
mainfrom
fix/137-configurable-probe-timeout

Conversation

@arimxyer

@arimxyer arimxyer commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

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 per pull_ttl_seconds window — but a slow-but-alive remote is treated identically: a legitimate >8s probe times out, stamps LastPullFailure, 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 existing pull_ttl_seconds tri-state via a small resolveProbeTimeout helper:

value meaning
0 built-in default (8s, unchanged)
> 0 that many seconds
< 0 disable the bound (unbounded probe)

Wired into the execExecutor constructed in NewService. 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_seconds and the previously-undocumented pull_ttl_seconds to 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 to execExecutor.runTimeout (white-box, package sync).

go build ✓ · go vet ✓ · go test ./... ✓ · golangci-lint run → 0 issues ✓

🤖 Generated with Claude Code

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
@arimxyer arimxyer merged commit 5c3aaf9 into main Jul 1, 2026
11 checks passed
@arimxyer arimxyer deleted the fix/137-configurable-probe-timeout branch July 1, 2026 21:32
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.

sync: make the rclone probe timeout configurable (slow-but-alive remote treated as failed)

1 participant