Chromium Code Reviews| Index: chrome/browser/sync/engine/sync_scheduler.cc |
| diff --git a/chrome/browser/sync/engine/sync_scheduler.cc b/chrome/browser/sync/engine/sync_scheduler.cc |
| index dafe685110934deb65a4cc439555877d64ce96e0..de475bf464ba402c0668588827bf7b8859c0f6fc 100644 |
| --- a/chrome/browser/sync/engine/sync_scheduler.cc |
| +++ b/chrome/browser/sync/engine/sync_scheduler.cc |
| @@ -901,27 +901,28 @@ void SyncScheduler::ScheduleNextSync(const SyncSessionJob& old_job) { |
| // should be able to detect such errors and only retry when we detect |
| // transient errors. |
| - // We are in backoff mode and our time did not run out. That means we had |
| - // a local change, notification from server or a network connection change |
| - // notification. In any case set had_nudge = true so we dont retry next |
| - // nudge. Note: we will keep retrying network connection changes though as |
| - // they are treated as canary jobs. Also we check the mode here because |
| - // we want to do this only in normal mode. For config mode jobs we dont |
| - // have anything similar to had_nudge. |
| - if (IsBackingOff() && wait_interval_->timer.IsRunning() && |
| + if (old_job.purpose == SyncSessionJob::POLL) { |
| + // We don't retry POLL jobs. |
|
tim (not reviewing)
2012/02/14 01:05:32
Hm, maybe our chat on IM confused me a bit. Decide
rlarocque
2012/02/14 01:59:36
If we didn't have this if statement, we would save
tim (not reviewing)
2012/02/15 02:21:29
It does rely on whether or not we're in a wait int
rlarocque
2012/02/17 20:51:02
Lots of minor points:
|
| + } else if (IsBackingOff() && wait_interval_->timer.IsRunning() && |
| mode_ == NORMAL_MODE) { |
| + // When in normal mode, we allow up to one nudge per backoff interval. It |
| + // appears that this was our nudge for this interval, and it failed. |
| + // |
| + // Note: This does not prevent us from running canary jobs. For example, an |
| + // IP address change might still result in another nudge being executed |
| + // during this backoff interval. |
| SDVLOG(2) << "A nudge during backoff failed"; |
| - // We weren't continuing but we're in backoff; must have been a nudge. |
| + |
| DCHECK_EQ(SyncSessionJob::NUDGE, old_job.purpose); |
| DCHECK(!wait_interval_->had_nudge); |
| + |
| wait_interval_->had_nudge = true; |
| - // Old job did not finish. So make it the pending job. |
| InitOrCoalescePendingJob(old_job); |
| - // Resume waiting. |
| RestartWaiting(); |
| } else { |
| + // Either this is the first failure or a consecutive failure after our |
| + // backoff timer expired. We handle it the same way in either case. |
| SDVLOG(2) << "Non-'backoff nudge' SyncShare job failed"; |
| - // We don't seem to have made forward progress. Start or extend backoff. |
| HandleContinuationError(old_job); |
| } |
| } |