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

Issue 2475043002: [Sync] Sync client should to exponential backoff when receive partial failure (Closed)

Created:
4 years, 1 month ago by Gang Wu
Modified:
4 years, 1 month ago
Reviewers:
Nicolas Zea
CC:
chromium-reviews, sync-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Sync] Sync client should to exponential backoff when receive partial failure. BUG=656072 Before this CL, Sync will throttle the data types in error_data_type_ids, which is wrong, Sync should exponential backoff those data type. This CL also fix several bugs. 1. When Sync client receive error THROTTLED, and error_data_type_ids is set, Sync client will throttle those datatypes, and also throttle whole client. This is wrong, the whole client should not get throttled in this case. To fix this, when this case happened, SyncerProtoUtil::PostClientToServerMessage will throttled the data types, and return PARTIAL_FAILURE instead of THROTTLED. 2. |scheduled_nudge_time_| in SyncSchedulerImpl is not update correctly, so Sync client will sync less frequently than expected. To fix this, I delete |scheduled_nudge_time_| and get the time directly from |global_wakeup_timer_| (previously pending_wakeup_timer_). 3. When Sync client received PARTIAL_FAILURE, not only the data type in error_data_type_ids got throttled, the whole client got exponential backoff. To fix this, add an early return in SyncSchedulerImpl::HandleFailure when receive PARTIAL_FAILURE. Committed: https://crrev.com/dcb17ac181e0c58d3bee7fece41e712df434f904 Cr-Commit-Position: refs/heads/master@{#432255}

Patch Set 1 : review by self #

Total comments: 18

Patch Set 2 : code review #

Total comments: 12

Patch Set 3 : fix backoff problem #

Total comments: 9

Patch Set 4 : add test #

Total comments: 12

Patch Set 5 : code review #

Total comments: 2

Patch Set 6 : update comments #

Patch Set 7 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+929 lines, -281 lines) Patch
M components/browser_sync/profile_sync_service.cc View 1 2 3 4 5 6 2 chunks +7 lines, -0 lines 0 comments Download
M components/sync/engine/sync_status.h View 1 chunk +3 lines, -0 lines 0 comments Download
M components/sync/engine_impl/all_status.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/sync/engine_impl/all_status.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M components/sync/engine_impl/cycle/data_type_tracker.h View 1 2 3 4 4 chunks +54 lines, -11 lines 0 comments Download
M components/sync/engine_impl/cycle/data_type_tracker.cc View 1 2 3 4 5 6 chunks +78 lines, -16 lines 0 comments Download
M components/sync/engine_impl/cycle/nudge_tracker.h View 1 2 3 2 chunks +23 lines, -11 lines 0 comments Download
M components/sync/engine_impl/cycle/nudge_tracker.cc View 1 2 3 2 chunks +42 lines, -22 lines 0 comments Download
M components/sync/engine_impl/cycle/nudge_tracker_unittest.cc View 1 2 4 chunks +150 lines, -59 lines 0 comments Download
M components/sync/engine_impl/cycle/sync_cycle.h View 1 chunk +3 lines, -0 lines 0 comments Download
M components/sync/engine_impl/cycle/test_util.h View 2 chunks +6 lines, -0 lines 0 comments Download
M components/sync/engine_impl/cycle/test_util.cc View 1 1 chunk +6 lines, -2 lines 0 comments Download
M components/sync/engine_impl/get_updates_delegate.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M components/sync/engine_impl/get_updates_processor.cc View 1 2 chunks +7 lines, -5 lines 0 comments Download
M components/sync/engine_impl/sync_engine_event_listener.h View 1 chunk +3 lines, -0 lines 0 comments Download
M components/sync/engine_impl/sync_manager_impl.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/sync/engine_impl/sync_manager_impl.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M components/sync/engine_impl/sync_scheduler_impl.h View 1 2 3 4 5 6 7 chunks +13 lines, -34 lines 0 comments Download
M components/sync/engine_impl/sync_scheduler_impl.cc View 1 2 25 chunks +104 lines, -92 lines 0 comments Download
M components/sync/engine_impl/sync_scheduler_impl_unittest.cc View 1 2 3 4 11 chunks +292 lines, -6 lines 0 comments Download
M components/sync/engine_impl/syncer_proto_util.cc View 1 2 chunks +12 lines, -5 lines 0 comments Download
M components/sync/engine_impl/syncer_unittest.cc View 6 chunks +91 lines, -6 lines 0 comments Download
M components/sync/test/engine/fake_sync_scheduler.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/sync/test/engine/fake_sync_scheduler.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M components/sync/test/engine/mock_connection_manager.h View 4 chunks +10 lines, -6 lines 0 comments Download
M components/sync/test/engine/mock_connection_manager.cc View 2 chunks +12 lines, -5 lines 0 comments Download

Messages

Total messages: 70 (54 generated)
Gang Wu
PTAL
4 years, 1 month ago (2016-11-08 19:03:08 UTC) #25
Nicolas Zea
https://codereview.chromium.org/2475043002/diff/80001/components/sync/engine_impl/cycle/data_type_tracker.cc File components/sync/engine_impl/cycle/data_type_tracker.cc (right): https://codereview.chromium.org/2475043002/diff/80001/components/sync/engine_impl/cycle/data_type_tracker.cc#newcode257 components/sync/engine_impl/cycle/data_type_tracker.cc:257: if (!IsBackedOff()) { nit: this should probably just be ...
4 years, 1 month ago (2016-11-09 00:21:25 UTC) #26
Gang Wu
Merged two timer to one timer. directly use Now() instead of pass it as parameter. ...
4 years, 1 month ago (2016-11-10 21:56:51 UTC) #31
Nicolas Zea
https://codereview.chromium.org/2475043002/diff/100001/components/sync/engine_impl/cycle/data_type_tracker.h File components/sync/engine_impl/cycle/data_type_tracker.h (right): https://codereview.chromium.org/2475043002/diff/100001/components/sync/engine_impl/cycle/data_type_tracker.h#newcode37 components/sync/engine_impl/cycle/data_type_tracker.h:37: WaitInterval(BlockingMode mode, base::TimeDelta length); nit: move this constructor above ...
4 years, 1 month ago (2016-11-10 23:28:22 UTC) #32
Gang Wu
fixed backoff issue. https://codereview.chromium.org/2475043002/diff/100001/components/sync/engine_impl/cycle/data_type_tracker.h File components/sync/engine_impl/cycle/data_type_tracker.h (right): https://codereview.chromium.org/2475043002/diff/100001/components/sync/engine_impl/cycle/data_type_tracker.h#newcode37 components/sync/engine_impl/cycle/data_type_tracker.h:37: WaitInterval(BlockingMode mode, base::TimeDelta length); On 2016/11/10 ...
4 years, 1 month ago (2016-11-11 19:15:31 UTC) #37
Nicolas Zea
Do you have any tests that ensure the backoff grows with repeated failures, and then ...
4 years, 1 month ago (2016-11-12 01:04:35 UTC) #38
Gang Wu
exponential backoff test added https://codereview.chromium.org/2475043002/diff/120001/components/sync/engine_impl/cycle/data_type_tracker.cc File components/sync/engine_impl/cycle/data_type_tracker.cc (right): https://codereview.chromium.org/2475043002/diff/120001/components/sync/engine_impl/cycle/data_type_tracker.cc#newcode275 components/sync/engine_impl/cycle/data_type_tracker.cc:275: wait_interval_->mode = WaitInterval::EXPONENTIAL_BACKOFF_RETRYING; On 2016/11/12 ...
4 years, 1 month ago (2016-11-14 19:14:51 UTC) #41
Nicolas Zea
Mostly LG with a couple cleanups/clarifications https://codereview.chromium.org/2475043002/diff/120001/components/sync/engine_impl/cycle/nudge_tracker_unittest.cc File components/sync/engine_impl/cycle/nudge_tracker_unittest.cc (right): https://codereview.chromium.org/2475043002/diff/120001/components/sync/engine_impl/cycle/nudge_tracker_unittest.cc#newcode474 components/sync/engine_impl/cycle/nudge_tracker_unittest.cc:474: nudge_tracker_.RecordSuccessfulSyncCycle(); On 2016/11/14 ...
4 years, 1 month ago (2016-11-14 21:57:15 UTC) #44
Gang Wu
updated. https://codereview.chromium.org/2475043002/diff/140001/components/sync/engine_impl/cycle/data_type_tracker.cc File components/sync/engine_impl/cycle/data_type_tracker.cc (right): https://codereview.chromium.org/2475043002/diff/140001/components/sync/engine_impl/cycle/data_type_tracker.cc#newcode133 components/sync/engine_impl/cycle/data_type_tracker.cc:133: // reset throtling and backoff state if state ...
4 years, 1 month ago (2016-11-15 01:59:32 UTC) #50
Nicolas Zea
lgtm https://codereview.chromium.org/2475043002/diff/180001/components/sync/engine_impl/cycle/data_type_tracker.cc File components/sync/engine_impl/cycle/data_type_tracker.cc (right): https://codereview.chromium.org/2475043002/diff/180001/components/sync/engine_impl/cycle/data_type_tracker.cc#newcode128 components/sync/engine_impl/cycle/data_type_tracker.cc:128: // If we were throttled, then we would ...
4 years, 1 month ago (2016-11-15 02:28:58 UTC) #53
Gang Wu
https://codereview.chromium.org/2475043002/diff/180001/components/sync/engine_impl/cycle/data_type_tracker.cc File components/sync/engine_impl/cycle/data_type_tracker.cc (right): https://codereview.chromium.org/2475043002/diff/180001/components/sync/engine_impl/cycle/data_type_tracker.cc#newcode128 components/sync/engine_impl/cycle/data_type_tracker.cc:128: // If we were throttled, then we would have ...
4 years, 1 month ago (2016-11-15 17:51:39 UTC) #60
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2475043002/200001
4 years, 1 month ago (2016-11-15 17:52:00 UTC) #61
commit-bot: I haz the power
Failed to apply patch for components/sync/engine_impl/sync_scheduler_impl.h: While running git apply --index -p1; error: patch failed: ...
4 years, 1 month ago (2016-11-15 17:58:47 UTC) #63
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2475043002/220001
4 years, 1 month ago (2016-11-15 18:31:15 UTC) #66
commit-bot: I haz the power
Committed patchset #7 (id:220001)
4 years, 1 month ago (2016-11-15 20:56:31 UTC) #68
commit-bot: I haz the power
4 years, 1 month ago (2016-11-15 21:00:45 UTC) #70
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/dcb17ac181e0c58d3bee7fece41e712df434f904
Cr-Commit-Position: refs/heads/master@{#432255}

Powered by Google App Engine
This is Rietveld 408576698