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

Unified Diff: sync/engine/syncer.cc

Issue 10006046: Abort sync cycles when download step fails (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/engine/sync_scheduler.cc ('k') | sync/engine/syncer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/syncer.cc
diff --git a/sync/engine/syncer.cc b/sync/engine/syncer.cc
index 62c7af893ff2d6dc91d74c53980c7a50f4eef564..8cf93e0d0764637e4bfe1d645818fa3f5829c1dd 100644
--- a/sync/engine/syncer.cc
+++ b/sync/engine/syncer.cc
@@ -166,13 +166,19 @@ void Syncer::SyncShare(sessions::SyncSession* session,
case STORE_TIMESTAMPS: {
StoreTimestampsCommand store_timestamps;
store_timestamps.Execute(session);
- // We should download all of the updates before attempting to process
- // them.
- if (session->status_controller().ServerSaysNothingMoreToDownload() ||
- !session->status_controller().download_updates_succeeded()) {
- next_step = APPLY_UPDATES;
- } else {
+ // We download all of the updates before attempting to apply them.
+ if (!session->status_controller().download_updates_succeeded()) {
+ // We may have downloaded some updates, but if the latest download
+ // attempt failed then we don't have all the updates. We'll leave
+ // it to a retry job to pick up where we left off.
+ last_step = SYNCER_END; // Necessary for CONFIGURATION mode.
+ next_step = SYNCER_END;
+ DVLOG(1) << "Aborting sync cycle due to download updates failure";
+ } else if (!session->status_controller()
+ .ServerSaysNothingMoreToDownload()) {
next_step = DOWNLOAD_UPDATES;
+ } else {
+ next_step = APPLY_UPDATES;
}
break;
}
« no previous file with comments | « sync/engine/sync_scheduler.cc ('k') | sync/engine/syncer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698