Chromium Code Reviews
Descriptionsync: remove buggy freshness condition in SyncSchedulerImpl add defensive DCHECKs.
We were using last_sync_session_end_time, which would effectively allow config jobs to cancel nudges that were scheduled to start before the config ended. There was code to reset the start time of nudges to hack around this, (which is removed in this patch) which was pretty confusing because after executing
if (scheduled_start < Now())
scheduled_start = Now();
scheduled_start is less than Now() again. This check was purely to get around the freshness check (AFAICT), and I think the new code is clearer. It also affects the Sync.Freq histogram, see bug for detail.
The integration tests also caught the fact that we weren't checking Succeeded() before updating that time, which means failed jobs could have caused legitimate nudges to be cancelled -- note this probably wasn't a big problem in practice due to the hack mentioned above. We now check Succeeded().
This also adds a few DCHECKs for situations that were previously unsupported but would technically squeak through. For example, there's a DCHECK in ScheduleConfiguration that there is no pending config job, but that situation could have arisen if we swapped to NORMAL_MODE and back before the config job executed -- in fact, one of the tests was doing this, but it's clearly unsupported.
Also fixes an issue with test_util::SimulateSuccess where we would not set ModelNeutralState results for config jobs, which meant that in some cases, tests would *not* reset wait_interval_ on successful backoff relief. The changes to the test file now ensure this can't regress.
BUG=143595
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=155370
Patch Set 1 : init #
Total comments: 4
Patch Set 2 : nudge time map #Patch Set 3 : comments / typo #Patch Set 4 : remove freshness condition #Patch Set 5 : move AutoReset #
Total comments: 9
Patch Set 6 : review 2 #Patch Set 7 : include order #Patch Set 8 : FIX #
Messages
Total messages: 14 (0 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||