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

Issue 146113003: sync: GU retry with less explicit TimeTicks logic (Closed)

Created:
6 years, 11 months ago by rlarocque
Modified:
6 years, 10 months ago
Reviewers:
haitaol1, pavely
CC:
chromium-reviews, tim+watch_chromium.org, rsimha+watch_chromium.org, haitaol+watch_chromium.org, maniscalco+watch_chromium.org
Visibility:
Public.

Description

sync: GU retry with less explicit TimeTicks logic For reasons described in crbug.com/338016, I changed my mind on explicit time tracking. This is an attempt to clean up my mistake. This new approach has the NudgeTracker keep track of the time when the next retry GU is scheduled, and a flag that is set to true when we should perform a retry GU at the next possible opportunity. Before a sync cycle, the NudgeTracker is provided with a TimeTicks::Now() value and asked to update the flag accordingly. This does a better job of ensuring the value of NudgeTracker::IsRetryRequired() is consistent. After this CL, we can guarantee that its value will be the same before, during, and after the sync cycle. The previous implementation relied on a call to TimeTicks::Now() in download.cc, so it did not have this property. There is one tricky part to this patch. We need to be careful that we the call to RecordSuccessfulSyncCycle() after a sync cycle does not overwrite pending retry state that may have been set by that sync cycle's SyncSessionDelegate::OnReceivedRetryDelay() function. To avoid that problem, we store the value from that call in the SyncScheduler and act on it only after we've updated the NudgeTracker's state when the sync cycle is complete. BUG=338016 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=248611

Patch Set 1 #

Total comments: 8

Patch Set 2 : Simplify updates; add more tests #

Total comments: 2

Patch Set 3 : Fix logic bug and add test for it #

Patch Set 4 : Update comments #

Patch Set 5 : One more comment update #

Total comments: 2

Patch Set 6 : Fix logic in GU retry fail edge case #

Total comments: 2

Patch Set 7 : Update NudgeTracker before normal mode transition cycle #

Unified diffs Side-by-side diffs Delta from patch set Stats (+317 lines, -108 lines) Patch
M sync/engine/download.cc View 1 chunk +1 line, -2 lines 0 comments Download
M sync/engine/download_unittest.cc View 1 2 3 chunks +12 lines, -3 lines 0 comments Download
M sync/engine/sync_scheduler_impl.h View 1 3 chunks +6 lines, -17 lines 0 comments Download
M sync/engine/sync_scheduler_impl.cc View 1 2 3 4 5 6 6 chunks +14 lines, -11 lines 0 comments Download
M sync/engine/sync_scheduler_unittest.cc View 1 1 chunk +4 lines, -4 lines 0 comments Download
M sync/engine/syncer.cc View 1 chunk +1 line, -1 line 0 comments Download
M sync/engine/syncer_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M sync/sessions/nudge_tracker.h View 1 2 3 3 chunks +36 lines, -7 lines 0 comments Download
M sync/sessions/nudge_tracker.cc View 1 2 3 4 5 4 chunks +41 lines, -8 lines 0 comments Download
M sync/sessions/nudge_tracker_unittest.cc View 1 2 3 4 5 13 chunks +200 lines, -53 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
rlarocque
I've come to the realization that it's unrealistic to expect that we can make the ...
6 years, 11 months ago (2014-01-25 00:15:00 UTC) #1
pavely
On 2014/01/25 00:15:00, rlarocque wrote: > I've come to the realization that it's unrealistic to ...
6 years, 11 months ago (2014-01-27 11:53:57 UTC) #2
pavely
https://codereview.chromium.org/146113003/diff/1/sync/engine/sync_scheduler_impl.cc File sync/engine/sync_scheduler_impl.cc (right): https://codereview.chromium.org/146113003/diff/1/sync/engine/sync_scheduler_impl.cc#newcode926 sync/engine/sync_scheduler_impl.cc:926: } Not required for this change but I would ...
6 years, 11 months ago (2014-01-27 11:54:05 UTC) #3
haitaol1
https://codereview.chromium.org/146113003/diff/1/sync/engine/sync_scheduler_impl.cc File sync/engine/sync_scheduler_impl.cc (right): https://codereview.chromium.org/146113003/diff/1/sync/engine/sync_scheduler_impl.cc#newcode484 sync/engine/sync_scheduler_impl.cc:484: ProcessReceivedGuRetryDelay(); Previously retry may be scheduled even when sync ...
6 years, 10 months ago (2014-01-27 23:17:06 UTC) #4
rlarocque
https://codereview.chromium.org/146113003/diff/1/sync/engine/sync_scheduler_impl.cc File sync/engine/sync_scheduler_impl.cc (right): https://codereview.chromium.org/146113003/diff/1/sync/engine/sync_scheduler_impl.cc#newcode484 sync/engine/sync_scheduler_impl.cc:484: ProcessReceivedGuRetryDelay(); On 2014/01/27 23:17:07, haitaol1 wrote: > Previously retry ...
6 years, 10 months ago (2014-01-28 01:06:33 UTC) #5
rlarocque
I've updated the callback that sets the GU retry time to make it a bit ...
6 years, 10 months ago (2014-01-28 02:29:36 UTC) #6
haitaol1
https://codereview.chromium.org/146113003/diff/80001/sync/sessions/nudge_tracker.cc File sync/sessions/nudge_tracker.cc (right): https://codereview.chromium.org/146113003/diff/80001/sync/sessions/nudge_tracker.cc#newcode253 sync/sessions/nudge_tracker.cc:253: if (next_retry_time_ < now) { where is next_retry_time nulled? ...
6 years, 10 months ago (2014-01-28 20:09:20 UTC) #7
rlarocque
I've updated the NudgeTracker logic. It's using timestamps instead of a flag now. I think ...
6 years, 10 months ago (2014-01-28 22:24:37 UTC) #8
haitaol1
https://codereview.chromium.org/146113003/diff/130001/sync/sessions/nudge_tracker.cc File sync/sessions/nudge_tracker.cc (right): https://codereview.chromium.org/146113003/diff/130001/sync/sessions/nudge_tracker.cc#newcode255 sync/sessions/nudge_tracker.cc:255: if (!next_retry_time_.is_null()) { Probably don't set current_retry_time if it's ...
6 years, 10 months ago (2014-01-28 23:07:23 UTC) #9
rlarocque
https://codereview.chromium.org/146113003/diff/130001/sync/sessions/nudge_tracker.cc File sync/sessions/nudge_tracker.cc (right): https://codereview.chromium.org/146113003/diff/130001/sync/sessions/nudge_tracker.cc#newcode255 sync/sessions/nudge_tracker.cc:255: if (!next_retry_time_.is_null()) { On 2014/01/28 23:07:23, haitaol1 wrote: > ...
6 years, 10 months ago (2014-01-28 23:17:09 UTC) #10
rlarocque
I misunderstood the desired behavior of one very unlikely edge case. It turns out that ...
6 years, 10 months ago (2014-01-29 00:03:47 UTC) #11
haitaol1
lgtm
6 years, 10 months ago (2014-01-29 00:32:56 UTC) #12
rlarocque
On 2014/01/29 00:32:56, haitaol1 wrote: > lgtm Thanks. Pavel: There have been quite a few ...
6 years, 10 months ago (2014-01-29 01:11:27 UTC) #13
pavely
On 2014/01/29 01:11:27, rlarocque wrote: > On 2014/01/29 00:32:56, haitaol1 wrote: > > lgtm > ...
6 years, 10 months ago (2014-01-29 01:14:03 UTC) #14
pavely
https://codereview.chromium.org/146113003/diff/150001/sync/engine/sync_scheduler_impl.cc File sync/engine/sync_scheduler_impl.cc (right): https://codereview.chromium.org/146113003/diff/150001/sync/engine/sync_scheduler_impl.cc#newcode237 sync/engine/sync_scheduler_impl.cc:237: (nudge_tracker_.IsSyncRequired() || nudge_tracker_.IsRetryRequired()) && SetSyncCycleStartTime isn't called in this ...
6 years, 10 months ago (2014-01-29 15:35:05 UTC) #15
rlarocque
https://codereview.chromium.org/146113003/diff/150001/sync/engine/sync_scheduler_impl.cc File sync/engine/sync_scheduler_impl.cc (right): https://codereview.chromium.org/146113003/diff/150001/sync/engine/sync_scheduler_impl.cc#newcode237 sync/engine/sync_scheduler_impl.cc:237: (nudge_tracker_.IsSyncRequired() || nudge_tracker_.IsRetryRequired()) && On 2014/01/29 15:35:05, pavely wrote: ...
6 years, 10 months ago (2014-01-29 18:27:41 UTC) #16
pavely
lgtm
6 years, 10 months ago (2014-02-03 20:52:23 UTC) #17
rlarocque
On 2014/02/03 20:52:23, pavely wrote: > lgtm Thanks for the reviews. This took a lot ...
6 years, 10 months ago (2014-02-03 20:54:54 UTC) #18
rlarocque
The CQ bit was checked by rlarocque@chromium.org
6 years, 10 months ago (2014-02-03 20:55:07 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/146113003/170001
6 years, 10 months ago (2014-02-03 20:55:14 UTC) #20
commit-bot: I haz the power
Change committed as 248611
6 years, 10 months ago (2014-02-03 23:36:01 UTC) #21
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-02-03 23:36:04 UTC) #22
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-02-03 23:36:06 UTC) #23
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-02-03 23:36:07 UTC) #24
commit-bot: I haz the power
CQ bit was unchecked on CL. Ignoring.
6 years, 10 months ago (2014-02-03 23:36:11 UTC) #25
commit-bot: I haz the power
6 years, 10 months ago (2014-02-03 23:36:24 UTC) #26
Message was sent while issue was closed.
CQ bit was unchecked on CL. Ignoring.

Powered by Google App Engine
This is Rietveld 408576698