fix: Syncthing startup reliability on slow Windows storage#16
Merged
Conversation
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
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.
Three issues from the live log on DESKTOP-M93J8NG:
1.
_STARTUP_WAIT30s → 60sSyncthing declared its API ready at
12:10:38but the initial DB scan kept it too busy to respond.wait_until_readygave up at12:11:10— the scan completed at12:11:14, 4 seconds too late.2. Per-ping timeout 10s → 3s (
_STARTUP_PING_TIMEOUT)With
_API_TIMEOUT=10sper 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: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