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

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: rearrange SetSyncerStepsForPurpose 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
Index: sync/engine/syncer.cc
diff --git a/sync/engine/syncer.cc b/sync/engine/syncer.cc
index 62c7af893ff2d6dc91d74c53980c7a50f4eef564..9b5d522edaf3cd5adc67023756c78255e6217f51 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.
tim (not reviewing) 2012/04/06 20:38:57 If we're going straight to END, why not call Reque
tim (not reviewing) 2012/04/06 20:48:21 Oh, I guess you *want* to run END. I think the c
+ next_step = SYNCER_END;
+ DVLOG(1) << "Aborting sync cycle due to download updates failure";
+ } else if (!session->status_controller()
+ .ServerSaysNothingMoreToDownload()) {
Nicolas Zea 2012/04/09 19:09:14 nit: indent by four more spaces
next_step = DOWNLOAD_UPDATES;
+ } else {
+ next_step = APPLY_UPDATES;
}
break;
}

Powered by Google App Engine
This is Rietveld 408576698