Skip to content

fix: Syncthing startup reliability on slow Windows storage#16

Merged
offbyonebit merged 1 commit into
mainfrom
fix/syncthing-startup-windows
May 21, 2026
Merged

fix: Syncthing startup reliability on slow Windows storage#16
offbyonebit merged 1 commit into
mainfrom
fix/syncthing-startup-windows

Conversation

@offbyonebit
Copy link
Copy Markdown
Owner

Three issues from the live log on DESKTOP-M93J8NG:

1. _STARTUP_WAIT 30s → 60s
Syncthing declared its API ready at 12:10:38 but the initial DB scan kept it too busy to respond. wait_until_ready gave up at 12:11:10 — the scan completed at 12:11:14, 4 seconds too late.

2. Per-ping timeout 10s → 3s (_STARTUP_PING_TIMEOUT)
With _API_TIMEOUT=10s per ping attempt, only 2–3 probes fit inside a 30s window (all timed out during the scan). With 3s/attempt and a 60s window we get ~17 attempts — enough to catch Syncthing when it becomes responsive.

3. Post-kill sleep 1s → 3s
After kill_orphaned_syncthings() the very next spawn hit:

ERR Failed to acquire lock: is another Syncthing instance already running?

Windows hadn't released Syncthing's LevelDB lock file within 1s of the process being killed.

https://claude.ai/code/session_0128MyVVEu1Dt3jTeaZ1edyL


Generated by Claude Code

Three issues from live Windows log (DESKTOP-M93J8NG):

1. _STARTUP_WAIT too short (30s → 60s): initial DB scan took ~40s,
   so wait_until_ready gave up 4s before scan completed.

2. Per-ping timeout too long: using _API_TIMEOUT=10s per startup probe
   meant only 2-3 attempts fit in 30s. New _STARTUP_PING_TIMEOUT=3s
   gives ~17 attempts in 60s.

3. Post-kill sleep too short (1s → 3s): spawn after kill_orphaned_-
   syncthings() hit "Failed to acquire lock" because Windows hadn't
   released Syncthing's LevelDB lock file yet.

https://claude.ai/code/session_0128MyVVEu1Dt3jTeaZ1edyL
@offbyonebit offbyonebit merged commit 02cd68e into main May 21, 2026
1 check 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.

2 participants