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

Issue 10006046: Abort sync cycles when download step fails (Closed)

Created:
8 years, 8 months ago by rlarocque
Modified:
8 years, 8 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Abort sync cycles when download step fails This change causes the syncer to exit from its download then commit function if the download fails. This helps prevent the creation of server-side conflicts, which would be more likely to happen if a download failed but the following commit succeeded. The main changes are as follows: - Rather than proceed to the next step when a download updates failure is detected, the syncer will exit. This should cause the SyncScheduler to schedule a retry at a later time. - The definition of a download updates failure is now based on the return code of the download attempt, rather than checking the contents of the (possible non-existent) returned protobuf. This makes the error detection logic used here more closely match the logic used to decide whether or not to schedule retries. This implementation has a side-effect on configure sync cycles. The old behaviour was to handle failures by applying whatever updates we had downloaded at that point. The new behaviour will leave updates unapplied if any error occurs. This better matches a nearby comment's assertion which states that we should not attempt to apply updates until we have downloaded all of them. I believe the author of that comment would approve of this change. This change moves around some of the ExtensionActivityMonitor logic. It's important that we not take the data from the extensions acitivity monitor at the start of the cycle. Restoring that data is handled in the commit building and response code, which might not be executed if we need to break out early. This also fixes issue 123270. Most of the diffs for this change are concentrated in the unit tests: - Expose more of the SyncScheduler to the SyncerTest test harness. - Add functions to SyncerTest for testing specific types of sync jobs. - Add some functions that allow us to better control failures in MockConnectionManager. - Added tests for configure job success and failure. - Added tests for update then commit job success and failure. - Removed some redundant tests. BUG=122033, 123270 TEST=sync_unit_tests, specifically: SyncerTest.UpdateThenCommit, SyncerTest.UpdateFailsThenDontCommit, SyncerTest.ConfigureDownloadsTwoBatchesSuccess, SyncerTest.ConfigureFailsDontApplyUpdates Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=132455

Patch Set 1 #

Patch Set 2 : rearrange SetSyncerStepsForPurpose #

Total comments: 9

Patch Set 3 : Review fixes #

Patch Set 4 : Rebase #

Total comments: 1

Patch Set 5 : Attempt to fix ExtensionsActivityMonitor #

Patch Set 6 : Retry on migration done responses #

Unified diffs Side-by-side diffs Delta from patch set Stats (+383 lines, -278 lines) Patch
M sync/engine/sync_scheduler.h View 1 3 chunks +7 lines, -6 lines 0 comments Download
M sync/engine/sync_scheduler.cc View 1 2 2 chunks +31 lines, -30 lines 0 comments Download
M sync/engine/syncer.cc View 1 2 3 4 3 chunks +25 lines, -17 lines 0 comments Download
M sync/engine/syncer_unittest.cc View 1 2 3 138 chunks +299 lines, -168 lines 0 comments Download
M sync/sessions/status_controller.h View 1 chunk +2 lines, -1 line 0 comments Download
M sync/sessions/sync_session.cc View 1 2 3 4 5 1 chunk +1 line, -2 lines 0 comments Download
M sync/sessions/sync_session_unittest.cc View 1 2 3 3 chunks +4 lines, -48 lines 0 comments Download
M sync/test/engine/mock_connection_manager.h View 3 chunks +10 lines, -3 lines 0 comments Download
M sync/test/engine/mock_connection_manager.cc View 2 chunks +4 lines, -3 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
rlarocque
Nicolas: More than anything else, it's the interactions between these changes and encryption that scare ...
8 years, 8 months ago (2012-04-06 20:35:09 UTC) #1
tim (not reviewing)
http://codereview.chromium.org/10006046/diff/2001/sync/engine/syncer.cc File sync/engine/syncer.cc (right): http://codereview.chromium.org/10006046/diff/2001/sync/engine/syncer.cc#newcode174 sync/engine/syncer.cc:174: last_step = SYNCER_END; // Necessary for CONFIGURATION mode. If ...
8 years, 8 months ago (2012-04-06 20:38:57 UTC) #2
tim (not reviewing)
http://codereview.chromium.org/10006046/diff/2001/sync/engine/syncer.cc File sync/engine/syncer.cc (right): http://codereview.chromium.org/10006046/diff/2001/sync/engine/syncer.cc#newcode174 sync/engine/syncer.cc:174: last_step = SYNCER_END; // Necessary for CONFIGURATION mode. On ...
8 years, 8 months ago (2012-04-06 20:48:21 UTC) #3
rlarocque
On 2012/04/06 20:48:21, timsteele wrote: > http://codereview.chromium.org/10006046/diff/2001/sync/engine/syncer.cc > File sync/engine/syncer.cc (right): > > http://codereview.chromium.org/10006046/diff/2001/sync/engine/syncer.cc#newcode174 > ...
8 years, 8 months ago (2012-04-06 20:59:31 UTC) #4
Nicolas Zea
Two nits, else non-tests LGTM Also, the only encryption-related work that can happen before ApplyUpdates ...
8 years, 8 months ago (2012-04-09 19:09:14 UTC) #5
tim (not reviewing)
http://codereview.chromium.org/10006046/diff/2001/sync/engine/sync_scheduler.cc File sync/engine/sync_scheduler.cc (right): http://codereview.chromium.org/10006046/diff/2001/sync/engine/sync_scheduler.cc#newcode686 sync/engine/sync_scheduler.cc:686: void SyncScheduler::SetSyncerStepsForPurpose( On 2012/04/06 20:35:09, rlarocque wrote: > This ...
8 years, 8 months ago (2012-04-12 01:28:20 UTC) #6
rlarocque
Patch updated.
8 years, 8 months ago (2012-04-12 02:32:05 UTC) #7
rlarocque
http://codereview.chromium.org/10006046/diff/12001/sync/engine/syncer.cc File sync/engine/syncer.cc (right): http://codereview.chromium.org/10006046/diff/12001/sync/engine/syncer.cc#newcode122 sync/engine/syncer.cc:122: session->context()->extensions_monitor()->GetAndClearRecords( While working on a different CL, I realized ...
8 years, 8 months ago (2012-04-12 21:34:31 UTC) #8
rlarocque
Updated with fix for issue 123270 and prevention of a related bug we almost created.
8 years, 8 months ago (2012-04-13 18:42:29 UTC) #9
tim (not reviewing)
On 2012/04/13 18:42:29, rlarocque wrote: > Updated with fix for issue 123270 and prevention of ...
8 years, 8 months ago (2012-04-13 18:47:27 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/10006046/18001
8 years, 8 months ago (2012-04-13 21:21:28 UTC) #11
commit-bot: I haz the power
Try job failure for 10006046-18001 (retry) on linux_rel for step "compile" (clobber build). It's a ...
8 years, 8 months ago (2012-04-13 21:54:22 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/10006046/18001
8 years, 8 months ago (2012-04-16 18:44:47 UTC) #13
commit-bot: I haz the power
8 years, 8 months ago (2012-04-16 21:22:07 UTC) #14
Change committed as 132455

Powered by Google App Engine
This is Rietveld 408576698