|
Avoid useless SYNC_CYCLE_CONTINUATION sync cycle
When exiting from a sync cycle, the SyncScheduler will look at the results of
the previous cycle and use them to determine when the next sync job should run.
Part of this is detecting whether or not the job failed.
Right now, we assume that num_unsynced_handles > 0 implies that we failed to
commit everything we should have. That's wrong, because that information was
calculated at the beginning of the job and doesn't get updated following the
commit. So num_unsynced_handles > 0 actually implies that we probably tried to
commit something, but it doesn't necessarily mean the commit failed.
Because of that faulty logic, we assume that every sync cycle that commits
something has in fact failed. We schedule another job soon after to clean up
the failure.
This commit attempts to fix that issue. It moves the logic for detecting the
failure into SyncSession::Succeeded() which will act as an interpreter for the
session's state. It also adds plumbing so that SyncerCommands can return
values indicating an error, and a some member variables in SyncSession to store
them. This allows us to implement SyncSession::Succeeded() so it returns false
only when we know of an actual error, rather than trying to infer this from
unsynced_handles.
This commit also adds a similar function,
SyncSession::ExperiencedTransientError(), that will report based on the
returned error codes whether or not we should schedule another sync cycle or
give up. There's not much point in retrying if the server is sending us
AuthErrors, and the return codes will allow us to see that information.
However, due to the risk of such a change, the ExperiencedTransientError()
function is not yet a part of the SyncScheduler's decision making.
Finally, this commit fixes issue 105994 because a recent change made it
so that I get -Werror compile errors locally because of that issue.
BUG= 94670, 105994
TEST=
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+448 lines, -197 lines) |
Patch |
 |
M |
chrome/browser/sync/engine/apply_updates_command.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/apply_updates_command.cc
|
View
|
|
2 chunks |
+5 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/build_and_process_conflict_sets_command.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/build_and_process_conflict_sets_command.cc
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/build_commit_command.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/build_commit_command.cc
|
View
|
|
2 chunks |
+3 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/cleanup_disabled_types_command.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/cleanup_disabled_types_command.cc
|
View
|
|
2 chunks |
+5 lines, -4 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/clear_data_command.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/clear_data_command.cc
|
View
|
|
5 chunks |
+10 lines, -5 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/download_updates_command.h
|
View
|
|
1 chunk |
+4 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/download_updates_command.cc
|
View
|
|
5 chunks |
+6 lines, -5 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/get_commit_ids_command.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/get_commit_ids_command.cc
|
View
|
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/model_changing_syncer_command.h
|
View
|
|
3 chunks |
+7 lines, -9 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/model_changing_syncer_command.cc
|
View
|
|
2 chunks |
+15 lines, -9 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/model_changing_syncer_command_unittest.cc
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/model_safe_worker.h
|
View
|
|
3 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/model_safe_worker.cc
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/passive_model_worker.h
|
View
|
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/passive_model_worker.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/post_commit_message_command.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/post_commit_message_command.cc
|
View
|
|
2 chunks |
+11 lines, -8 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/process_commit_response_command.h
|
View
|
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/process_commit_response_command.cc
|
View
|
|
7 chunks |
+25 lines, -17 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/process_updates_command.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/process_updates_command.cc
|
View
|
|
2 chunks |
+5 lines, -3 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/resolve_conflicts_command.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/resolve_conflicts_command.cc
|
View
|
|
1 chunk |
+6 lines, -6 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/store_timestamps_command.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/store_timestamps_command.cc
|
View
|
|
2 chunks |
+5 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/sync_scheduler.cc
|
View
|
|
2 chunks |
+8 lines, -18 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/syncer.cc
|
View
|
|
2 chunks |
+7 lines, -3 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/syncer_command.h
|
View
|
|
3 chunks |
+5 lines, -3 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/syncer_command.cc
|
View
|
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
A |
chrome/browser/sync/engine/syncer_error.h
|
View
|
|
1 chunk |
+37 lines, -0 lines |
0 comments
|
Download
|
 |
A |
chrome/browser/sync/engine/syncer_error.cc
|
View
|
|
1 chunk |
+35 lines, -0 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/syncer_proto_util.h
|
View
|
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/syncer_proto_util.cc
|
View
|
|
4 chunks |
+45 lines, -11 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/verify_updates_command.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/engine/verify_updates_command.cc
|
View
|
|
2 chunks |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/glue/browser_thread_model_worker.h
|
View
|
|
5 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/glue/browser_thread_model_worker.cc
|
View
|
|
4 chunks |
+11 lines, -11 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc
|
View
|
|
2 chunks |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/glue/history_model_worker.h
|
View
|
|
2 chunks |
+1 line, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/glue/history_model_worker.cc
|
View
|
|
3 chunks |
+8 lines, -8 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/glue/password_model_worker.h
|
View
|
|
3 chunks |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/glue/password_model_worker.cc
|
View
|
|
1 chunk |
+6 lines, -6 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/glue/ui_model_worker.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/glue/ui_model_worker.cc
|
View
|
|
4 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/glue/ui_model_worker_unittest.cc
|
View
|
|
2 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/sessions/session_state.h
|
View
|
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/sessions/session_state.cc
|
View
|
|
1 chunk |
+4 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/sessions/status_controller.h
|
View
|
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/sessions/status_controller.cc
|
View
|
|
1 chunk |
+13 lines, -0 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/sessions/sync_session.h
|
View
|
|
1 chunk |
+16 lines, -0 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/sessions/sync_session.cc
|
View
|
|
1 chunk |
+77 lines, -0 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/sessions/test_util.cc
|
View
|
|
1 chunk |
+4 lines, -11 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/test/engine/fake_model_worker.h
|
View
|
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/test/engine/fake_model_worker.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/chrome.gyp
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
Total messages: 3 (0 generated)
|