Mark the account offline when its server is unreachable (#179) - #187
Merged
Merged
Conversation
A Failed outcome alone cannot tell a broken folder from an unreachable account (a reverse proxy answering 502, a dead backend). Two halves: - Engine: a 5xx from the remote ensurer, or a run ending Failed, now triggers a short server health probe. A dead probe upgrades the outcome to NetworkError without spawning nextcloudcmd; a live probe keeps the folder-level Failed. - Scheduler: a NetworkError outcome arms a server-unreachable gate. Automatic triggers only queue (the folder stops occupying the global permit, so a healthy account keeps syncing) and a 30s probe re-checks the server until the first success clears the gate. The folder row reads 'Synchronization blocked: the server is unreachable' instead of the generic network message.
4 tasks
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.
Implements #179: when a folder fails and a health probe against the server fails, the account goes offline instead of showing "Connected" and retrying on every trigger.
Changes:
HealthProbe+ProductionHealthProbein the sync engine (sync_engine.rs), usingNextcloudApi::server_status(GET to the server root; <500 = alive, 5xx/transport = dead).Http{5xx}runs the probe and short-circuits toNetworkErrorwithout spawning nextcloudcmd when the server is dead; aFailedrun with a dead probe becomesNetworkError.server_unreachablegate +schedule_server_probe()every 30s (SERVER_PROBE_INTERVAL_MS) that re-checks and recovers; non-manual triggers only queue while unreachable, freeing the global sync permit for healthy folders.Context: the 26-Aug incident where hub.cloudless.club returned 502 all day (CT 222 lost its DHCP IP) and the account kept showing "Connected" while every sync failed.