Cache local sync state on start to prevent race conditions during initialization |
|||
Issue descriptionCurrently the pref value can change if the policy is flipped while sync is initializing and cause undesirable effects or data loss.
,
Jul 24 2017
Sky, thinking more about this I think it is better to implement this like the SyncDisabled policy code. Read the value from the pref store when needed but also install an observer for value changes. If the value changes no matter from what to what I think the least we can do is issue a StopImpl(CLEAR_DATA) to clear the internal sync state so that on the next run Sync can pick up a new source. Optimally we can also issue a TryStart on the controller once the StopImpl command has finished. This way unless the user has explicitly suppressed it or the SyncDisabled policy is in effect sync will restart with the newly selected backend. What do you think?
,
Jul 26 2017
I am taking this back. For now this is not feasible because a lot of the initialization depends on the flag so resetting the sync service on the fly seems rather impossible without significant refactoring. I will implement the caching as discussed instead.
,
Aug 1 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a032fa6ac58821217a2515dd826c5d19aa4b50e0 commit a032fa6ac58821217a2515dd826c5d19aa4b50e0 Author: Julian Pastarmov <pastarmovj@chromium.org> Date: Tue Aug 01 13:35:08 2017 [sync] Cache the value of kEnableLocalSyncBackend in SyncPrefs. The value could change during startup when delivered through policy but the backend can not be switched on the fly. So make sure the first seen value is preserved. BUG= 736408 Change-Id: Ie608e9735b6009df3cd7070338412bd5b83376f4 Reviewed-on: https://chromium-review.googlesource.com/586688 Reviewed-by: Sky Malice <skym@chromium.org> Commit-Queue: Julian Pastarmov <pastarmovj@chromium.org> Cr-Commit-Position: refs/heads/master@{#490970} [modify] https://crrev.com/a032fa6ac58821217a2515dd826c5d19aa4b50e0/components/sync/base/sync_prefs.cc [modify] https://crrev.com/a032fa6ac58821217a2515dd826c5d19aa4b50e0/components/sync/base/sync_prefs.h
,
Aug 1 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by pastarmovj@chromium.org
, Jun 23 2017