diff options
author | zea <zea@chromium.org> | 2015-05-13 11:47:22 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-13 18:47:27 +0000 |
commit | 938b3c001b85f2193151dda0ae659ba776d12e1f (patch) | |
tree | 63078aef6243ecf135b4c2bf62928da8daa657c9 /sync/engine/sync_scheduler_impl.h | |
parent | 7645c83d60e5370365b163bde56ef2158eb97678 (diff) | |
download | chromium_src-938b3c001b85f2193151dda0ae659ba776d12e1f.zip chromium_src-938b3c001b85f2193151dda0ae659ba776d12e1f.tar.gz chromium_src-938b3c001b85f2193151dda0ae659ba776d12e1f.tar.bz2 |
Revert of [Sync] Refactoring polling to be reliable. (patchset #5 id:80001 of https://codereview.chromium.org/1132013004/)
Reason for revert:
Failing on valgrind bots
Original issue's description:
> [Sync] Refactoring polling to be reliable.
>
> Polling is now an important component of sync health, as it can sometimes be
> the only time we'll query for certain datatypes. As such, the following
> has changed:
> - Polls that fail will be retried (with backoff).
> - As such, the logic to force a poll after an auth error isn't needed anymore
> - The last successful poll time will be persisted in the sync prefs.
> - On startup, schedule the first poll for last_poll_time + poll_interval
> (or Now(), whichever is latest).
> - Receiving a new poll interval from the server will update the poll timer
> - The poll timer is now a one shot timer, and only restarts on success
> - Some code cleanup to make the above more straightforward
>
> BUG=482154
>
> Committed: https://crrev.com/3777d8727d7b4caedfb72bfdcbe2fea1f1d1d594
> Cr-Commit-Position: refs/heads/master@{#329669}
TBR=pavely@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=482154
Review URL: https://codereview.chromium.org/1144443004
Cr-Commit-Position: refs/heads/master@{#329683}
Diffstat (limited to 'sync/engine/sync_scheduler_impl.h')
-rw-r--r-- | sync/engine/sync_scheduler_impl.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/sync/engine/sync_scheduler_impl.h b/sync/engine/sync_scheduler_impl.h index b7d8d0b..e3c505b 100644 --- a/sync/engine/sync_scheduler_impl.h +++ b/sync/engine/sync_scheduler_impl.h @@ -51,7 +51,7 @@ class SYNC_EXPORT_PRIVATE SyncSchedulerImpl // Calls Stop(). ~SyncSchedulerImpl() override; - void Start(Mode mode, base::Time last_poll_time) override; + void Start(Mode mode) override; void ScheduleConfiguration(const ConfigurationParams& params) override; void Stop() override; void ScheduleLocalNudge( @@ -151,10 +151,7 @@ class SYNC_EXPORT_PRIVATE SyncSchedulerImpl // Invoke the syncer to perform a configuration job. void DoConfigurationSyncSessionJob(JobPriority priority); - // Helper function for Do{Nudge,Configuration,Poll}SyncSessionJob. - void HandleSuccess(); - - // Helper function for Do{Nudge,Configuration,Poll}SyncSessionJob. + // Helper function for Do{Nudge,Configuration}SyncSessionJob. void HandleFailure( const sessions::ModelNeutralState& model_neutral_state); @@ -249,10 +246,8 @@ class SYNC_EXPORT_PRIVATE SyncSchedulerImpl base::TimeDelta syncer_short_poll_interval_seconds_; base::TimeDelta syncer_long_poll_interval_seconds_; - // Timer for polling. Restarted on each successful poll, and when entering - // normal sync mode or exiting an error state. Not active in configuration - // mode. - base::OneShotTimer<SyncSchedulerImpl> poll_timer_; + // Periodic timer for polling. See AdjustPolling. + base::RepeatingTimer<SyncSchedulerImpl> poll_timer_; // The mode of operation. Mode mode_; @@ -296,6 +291,15 @@ class SYNC_EXPORT_PRIVATE SyncSchedulerImpl // could result in tight sync loops hitting sync servers. bool no_scheduling_allowed_; + // crbug/251307. This is a workaround for M29. crbug/259913 tracks proper fix + // for M30. + // The issue is that poll job runs after few hours of inactivity and therefore + // will always fail with auth error because of expired access token. Once + // fresh access token is requested poll job is not retried. + // The change is to remember that poll timer just fired and retry poll job + // after credentials are updated. + bool do_poll_after_credentials_updated_; + // TryJob might get called for multiple reasons. It should only call // DoPollSyncSessionJob after some time since the last attempt. // last_poll_reset_ keeps track of when was last attempt. |