summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-26 02:55:20 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-26 02:55:20 +0000
commitb5f5c45835ae1820a89180ee528e79da483ebbba (patch)
tree0695da114439d13712384e9c20e21fa5b6646b78
parentc9536a170eb95ca6c27f26e25d63b63cbbf263e1 (diff)
downloadchromium_src-b5f5c45835ae1820a89180ee528e79da483ebbba.zip
chromium_src-b5f5c45835ae1820a89180ee528e79da483ebbba.tar.gz
chromium_src-b5f5c45835ae1820a89180ee528e79da483ebbba.tar.bz2
Remove SyncSessionJob::DidReachServer() flag
This flag was added in r140885 to address issue 131414. The problem was that SyncSessionJobs that did not contact the server would succeed and attempt to reset the backoff interval. The commits r149052 and r143088 removed the job types that do not attempt to contact the server, so we no longer need to worry about them accidentally distrupting backoff. BUG=175024 Review URL: https://chromiumcodereview.appspot.com/12320104 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184566 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--sync/engine/sync_scheduler_impl.cc12
-rw-r--r--sync/internal_api/public/util/syncer_error.h2
-rw-r--r--sync/sessions/sync_session.cc7
-rw-r--r--sync/sessions/sync_session.h6
4 files changed, 4 insertions, 23 deletions
diff --git a/sync/engine/sync_scheduler_impl.cc b/sync/engine/sync_scheduler_impl.cc
index ef6ae6d..c30b78d 100644
--- a/sync/engine/sync_scheduler_impl.cc
+++ b/sync/engine/sync_scheduler_impl.cc
@@ -844,14 +844,10 @@ void SyncSchedulerImpl::ScheduleNextSync(
AdjustPolling(finished_job.get());
if (succeeded) {
- // Only reset backoff if we actually reached the server.
- // It's possible that we reached the server on one attempt, then had an
- // error on the next (or didn't perform some of the server-communicating
- // commands). We want to verify that, for all commands attempted, we
- // successfully spoke with the server. Therefore, we verify no errors
- // and at least one SYNCER_OK.
- if (finished_job->session()->DidReachServer())
- wait_interval_.reset();
+ // No job currently supported by the scheduler could succeed without
+ // successfully reaching the server. Therefore, if we make it here, it is
+ // appropriate to reset the backoff interval.
+ wait_interval_.reset();
SDVLOG(2) << "Job succeeded so not scheduling more jobs";
return;
}
diff --git a/sync/internal_api/public/util/syncer_error.h b/sync/internal_api/public/util/syncer_error.h
index 9711597..634d8e1d 100644
--- a/sync/internal_api/public/util/syncer_error.h
+++ b/sync/internal_api/public/util/syncer_error.h
@@ -29,8 +29,6 @@ enum SYNC_EXPORT_PRIVATE SyncerError {
// Based on values returned by server. Most are defined in sync.proto.
SERVER_RETURN_INVALID_CREDENTIAL,
- FIRST_SERVER_RETURN_VALUE = SERVER_RETURN_INVALID_CREDENTIAL,
-
SERVER_RETURN_UNKNOWN_ERROR,
SERVER_RETURN_THROTTLED,
SERVER_RETURN_TRANSIENT_ERROR,
diff --git a/sync/sessions/sync_session.cc b/sync/sessions/sync_session.cc
index 11c95eb..b7ff433 100644
--- a/sync/sessions/sync_session.cc
+++ b/sync/sessions/sync_session.cc
@@ -75,12 +75,5 @@ void SyncSession::SendEventNotification(SyncEngineEvent::EventCause cause) {
context()->NotifyListeners(event);
}
-bool SyncSession::DidReachServer() const {
- const ModelNeutralState& state = status_controller_->model_neutral_state();
- return state.last_get_key_result >= FIRST_SERVER_RETURN_VALUE ||
- state.last_download_updates_result >= FIRST_SERVER_RETURN_VALUE ||
- state.commit_result >= FIRST_SERVER_RETURN_VALUE;
-}
-
} // namespace sessions
} // namespace syncer
diff --git a/sync/sessions/sync_session.h b/sync/sessions/sync_session.h
index 7271b5f..9272bae 100644
--- a/sync/sessions/sync_session.h
+++ b/sync/sessions/sync_session.h
@@ -106,12 +106,6 @@ class SYNC_EXPORT_PRIVATE SyncSession {
// Builds and sends a snapshot to the session context's listeners.
void SendEventNotification(SyncEngineEvent::EventCause cause);
- // Returns true if we reached the server. Note that "reaching the server"
- // here means that from an HTTP perspective, we succeeded (HTTP 200). The
- // server **MAY** have returned a sync protocol error.
- // See SERVER_RETURN_* in the SyncerError enum for values.
- bool DidReachServer() const;
-
// Overwrite the sync update source with the most recent and merge the
// type/state map.
void CoalesceSources(const SyncSourceInfo& source);