Repository navigation
fix(sync): foreground and a network return wake the core's scheduler, never ahead of a retry delay - #4809
Merged
Conversation
… never ahead of a retry delay Mac and Windows asked for these passes with sync_now, which skipped the scheduler's Retry-After and backoff; the Mac asked only while iCloud ran.
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.
Summary
SyncService::wake(why)over the FFI, throughSyncHost::wake: returns at once and asks each running engine's scheduler for a pass. The scheduler runs it soon, folds repeated wakes into one pass, never runs two at once, and holds it until any retry delay it keeps has passed (Retry-After, backoff after 429/503/5xx, CloudKit throttle).sync_nowdid.SyncHost.NudgeAsyncbecomesSyncHost.WakeoverTableProSync.Wake, so foreground and network return no longer skip the server's retry delay. Bindings regenerated.SyncProviderCoordinatorTestsactivationIsHeldForTheInterval,journalReachesTheEngineAndDebouncesAPassandnoticeWakesTheScheduler(wasnoticeAsksForAPass) now expect a wake, not a pass.Test plan
core/crates/sync/tests/engine/wake.rs: a wake runs a pass at once; many wakes run one; a wake during a pass starts no second; a wake inside Retry-After waits it out; a network return ends only a network failure's wait; endless journal wakes do not hold off the poll.core/crates/ffi/src/sync/tests.rs: a wake's pass finds a new team long before the 60 s poll.SyncProviderCoordinatorTests: iCloud off wakes the open service on activation and network return; no open service opens none; a network return wakes the scheduler during a pass; a scheduled pass saves the subscription.SyncHostTestsand interopSyncTests: the Windows wake reaches the open engine and returns at once after a close.