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

Unified Diff: sync/engine/backoff_delay_provider.cc

Issue 11411041: sync: Retry soon when server returns conflict (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comment Created 8 years, 1 month 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 | « no previous file | sync/engine/backoff_delay_provider_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/backoff_delay_provider.cc
diff --git a/sync/engine/backoff_delay_provider.cc b/sync/engine/backoff_delay_provider.cc
index d030e26f327dceed2e04e35550f599132ce5fab7..f8e2750876fd9a87d10ce49d0203efca41bef458 100644
--- a/sync/engine/backoff_delay_provider.cc
+++ b/sync/engine/backoff_delay_provider.cc
@@ -97,6 +97,18 @@ TimeDelta BackoffDelayProvider::GetInitialDelay(
return short_initial_backoff_;
}
+ // When the server tells us we have a conflict, then we should download the
+ // latest updates so we can see the conflict ourselves, resolve it locally,
+ // then try again to commit. Running another sync cycle will do all these
+ // things. There's no need to back off, we can do this immediately.
+ //
+ // TODO(sync): We shouldn't need to handle this in BackoffDelayProvider.
+ // There should be a way to deal with protocol errors before we get to this
+ // point.
+ if (state.commit_result == SERVER_RETURN_CONFLICT) {
+ return short_initial_backoff_;
+ }
+
return default_initial_backoff_;
}
« no previous file with comments | « no previous file | sync/engine/backoff_delay_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698