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

Issue 10103017: 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. - Removed unused test infrastructure. This change allows the integration tests to expose a bug that was introduced back in r118572. That commit assumed it was OK to not retry a job that failed due to a MIGRATION_DONE response from the server. That is incorrect, and this error has been fixed. 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=133754

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Another approach at handling migration #

Patch Set 4 : Update comments #

Patch Set 5 : Fix unit test and remove ServerSaysNothingMoreToDownload() #

Total comments: 17

Patch Set 6 : Rebase on top of migration fixes #

Patch Set 7 : Remove notifications re-enable code #

Unified diffs Side-by-side diffs Delta from patch set Stats (+416 lines, -344 lines) Patch
M chrome/browser/sync/test/integration/migration_errors_test.cc View 1 2 3 4 5 6 8 chunks +10 lines, -17 lines 0 comments Download
M sync/engine/sync_scheduler.h View 3 chunks +7 lines, -6 lines 0 comments Download
M sync/engine/sync_scheduler.cc View 2 chunks +31 lines, -30 lines 0 comments Download
M sync/engine/syncer.cc View 3 4 5 3 chunks +25 lines, -17 lines 0 comments Download
M sync/engine/syncer_unittest.cc View 1 2 3 4 5 150 chunks +323 lines, -180 lines 0 comments Download
M sync/sessions/status_controller.h View 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M sync/sessions/sync_session_unittest.cc View 3 4 5 3 chunks +4 lines, -48 lines 0 comments Download
M sync/test/engine/mock_connection_manager.h View 1 2 3 4 5 3 chunks +10 lines, -18 lines 0 comments Download
M sync/test/engine/mock_connection_manager.cc View 1 2 3 4 5 3 chunks +4 lines, -27 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
rlarocque
This is the second attempt at http://codereview.chromium.org/10006046/. Here's why the original failed: First of all, ...
8 years, 8 months ago (2012-04-17 01:16:05 UTC) #1
rlarocque
On 2012/04/17 01:16:05, rlarocque wrote: > This is the second attempt at http://codereview.chromium.org/10006046/. Here's > ...
8 years, 8 months ago (2012-04-17 18:18:24 UTC) #2
rlarocque
On 2012/04/17 18:18:24, rlarocque wrote: > On 2012/04/17 01:16:05, rlarocque wrote: > > This is ...
8 years, 8 months ago (2012-04-18 01:44:15 UTC) #3
rlarocque
> It turns out the previous approach was a dead-end. The details can be found ...
8 years, 8 months ago (2012-04-18 01:46:10 UTC) #4
rlarocque
On 2012/04/18 01:46:10, rlarocque wrote: > > It turns out the previous approach was a ...
8 years, 8 months ago (2012-04-19 23:05:03 UTC) #5
tim (not reviewing)
http://codereview.chromium.org/10103017/diff/21001/sync/engine/syncer.cc File sync/engine/syncer.cc (right): http://codereview.chromium.org/10103017/diff/21001/sync/engine/syncer.cc#newcode163 sync/engine/syncer.cc:163: session->status_controller().updates_response(); You're doing this just to get changes_remaining, right? ...
8 years, 8 months ago (2012-04-20 16:41:07 UTC) #6
rlarocque
I'm flip-flopping back to the other approach. Your comments about testing the migration-specific workarounds made ...
8 years, 8 months ago (2012-04-23 20:16:48 UTC) #7
rlarocque
Please review. Here's the new patch. It's similar to the one I tried to land ...
8 years, 8 months ago (2012-04-23 20:39:01 UTC) #8
rlarocque
Patch set 7 is meant to fix some integration test flakiness I've been seeing on ...
8 years, 8 months ago (2012-04-24 17:25:36 UTC) #9
tim (not reviewing)
This patch looks great. Nice work. LGTM
8 years, 8 months ago (2012-04-24 17:39:55 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/10103017/41001
8 years, 8 months ago (2012-04-24 18:45:48 UTC) #11
commit-bot: I haz the power
8 years, 8 months ago (2012-04-24 20:29:09 UTC) #12
Change committed as 133754

Powered by Google App Engine
This is Rietveld 408576698