Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Issue 10825439: sync: remove buggy freshness condition in SyncSchedulerImpl add defensive DCHECKs. (Closed)

Created:
8 years, 4 months ago by tim (not reviewing)
Modified:
8 years, 3 months ago
Reviewers:
rlarocque, Nicolas Zea
CC:
chromium-reviews
Visibility:
Public.

Description

sync: 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+156 lines, -64 lines) Patch
M sync/engine/sync_scheduler_impl.h View 1 2 3 4 5 6 4 chunks +21 lines, -5 lines 0 comments Download
M sync/engine/sync_scheduler_impl.cc View 1 2 3 4 5 6 7 13 chunks +79 lines, -22 lines 0 comments Download
M sync/engine/sync_scheduler_unittest.cc View 1 2 3 16 chunks +43 lines, -27 lines 0 comments Download
M sync/engine/sync_scheduler_whitebox_unittest.cc View 1 2 3 2 chunks +0 lines, -5 lines 0 comments Download
M sync/sessions/test_util.cc View 1 1 chunk +13 lines, -5 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
tim (not reviewing)
Hey guys, please review. Nicolas, let me know what your thoughts are on the Freq ...
8 years, 4 months ago (2012-08-20 05:46:34 UTC) #1
rlarocque
I tried to find a way to break this using only a series of NUDGEs, ...
8 years, 4 months ago (2012-08-20 19:02:20 UTC) #2
Nicolas Zea
Re histograms, I think we really need to track per-datatype delays. WIthout that, as you ...
8 years, 4 months ago (2012-08-20 20:31:58 UTC) #3
tim (not reviewing)
On 2012/08/20 19:02:20, rlarocque wrote: > I tried to find a way to break this ...
8 years, 3 months ago (2012-08-27 21:19:01 UTC) #4
tim (not reviewing)
http://codereview.chromium.org/10825439/diff/13001/sync/sessions/test_util.cc File sync/sessions/test_util.cc (right): http://codereview.chromium.org/10825439/diff/13001/sync/sessions/test_util.cc#newcode55 sync/sessions/test_util.cc:55: case APPLY_UPDATES: On 2012/08/20 20:31:58, nzea wrote: > Note ...
8 years, 3 months ago (2012-08-27 21:19:38 UTC) #5
tim (not reviewing)
New patch uploaded that no longer drops most stale NUDGEs as part of the freshness ...
8 years, 3 months ago (2012-09-05 01:08:28 UTC) #6
tim (not reviewing)
On 2012/09/05 01:08:28, timsteele wrote: > New patch uploaded that no longer drops most stale ...
8 years, 3 months ago (2012-09-05 15:57:34 UTC) #7
tim (not reviewing)
PTAL. I added an assertion for a case that was previously handled by the freshness ...
8 years, 3 months ago (2012-09-06 21:47:27 UTC) #8
rlarocque
LGTM. I'd like to hear Nicolas' opinion before commit, though.
8 years, 3 months ago (2012-09-06 22:17:13 UTC) #9
Nicolas Zea
http://codereview.chromium.org/10825439/diff/25008/sync/engine/sync_scheduler_impl.cc File sync/engine/sync_scheduler_impl.cc (right): http://codereview.chromium.org/10825439/diff/25008/sync/engine/sync_scheduler_impl.cc#newcode826 sync/engine/sync_scheduler_impl.cc:826: // We are interested in recording time between local ...
8 years, 3 months ago (2012-09-06 22:40:57 UTC) #10
tim (not reviewing)
http://codereview.chromium.org/10825439/diff/25008/sync/engine/sync_scheduler_impl.cc File sync/engine/sync_scheduler_impl.cc (right): http://codereview.chromium.org/10825439/diff/25008/sync/engine/sync_scheduler_impl.cc#newcode826 sync/engine/sync_scheduler_impl.cc:826: // We are interested in recording time between local ...
8 years, 3 months ago (2012-09-06 23:12:52 UTC) #11
Nicolas Zea
LGTM!
8 years, 3 months ago (2012-09-07 00:04:20 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tim@chromium.org/10825439/22009
8 years, 3 months ago (2012-09-07 00:14:41 UTC) #13
commit-bot: I haz the power
8 years, 3 months ago (2012-09-07 12:57:15 UTC) #14
Change committed as 155370

Powered by Google App Engine
This is Rietveld 408576698