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

Issue 7861013: Fix the false-positive detection of commit errors (Closed)

Created:
9 years, 3 months ago by rlarocque
Modified:
9 years, 2 months ago
CC:
chromium-reviews, Raghu Simha, ncarter (slow), tim (not reviewing), idana
Visibility:
Public.

Description

Fix the false-positive detection of commit errors 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::ExperiencedTransientError() which will act as an interpreter for the session's state. This should make it more difficult to misinterprent the session's state information in the future. The function's definition uses a different, hopefully better, set of tests to determine whether or not the sync cycle failed to make progress. This commit also changes the way the MIGRATION_DONE "error" code is handled. We don't want MIGRATION_DONE to trigger a backoff, which is what it would do given how we defined ExperiencedTransientError(). The fix is to change the way we deal with this value, so it does not increment the consecutive error counter. BUG=94670 TEST=

Patch Set 1 #

Total comments: 11

Patch Set 2 : Renames and refactors #

Total comments: 1

Patch Set 3 : More renames, less refactors #

Patch Set 4 : Don't treat MIGRATION_DONE as an error #

Total comments: 4

Patch Set 5 : Another attempt at detecting errors #

Unified diffs Side-by-side diffs Delta from patch set Stats (+458 lines, -200 lines) Patch
M chrome/browser/automation/testing_automation_provider.h View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/automation/testing_automation_provider.cc View 1 2 3 4 5 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/sync/engine/clear_data_command.cc View 1 2 3 4 3 chunks +16 lines, -6 lines 0 comments Download
M chrome/browser/sync/engine/download_updates_command.cc View 1 2 3 4 4 chunks +9 lines, -3 lines 0 comments Download
M chrome/browser/sync/engine/post_commit_message_command.cc View 1 2 3 4 1 chunk +13 lines, -5 lines 0 comments Download
M chrome/browser/sync/engine/sync_scheduler.cc View 1 2 3 4 3 chunks +5 lines, -20 lines 0 comments Download
M chrome/browser/sync/engine/syncer_proto_util.h View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/sync/engine/syncer_proto_util.cc View 1 2 3 4 8 chunks +73 lines, -25 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.h View 1 2 3 4 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.cc View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/internal_api/sync_manager.h View 1 2 3 4 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/sync/internal_api/syncapi_unittest.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/js/js_sync_manager_observer.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/js/js_sync_manager_observer.cc View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/js/js_sync_manager_observer_unittest.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/profile_sync_service.h View 1 2 3 4 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/sync/profile_sync_service.cc View 1 2 3 4 4 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_harness.h View 1 2 3 4 3 chunks +28 lines, -5 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_harness.cc View 1 2 3 4 17 chunks +92 lines, -33 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_mock.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/protocol/sync_protocol_error.h View 1 2 3 4 3 chunks +21 lines, -7 lines 0 comments Download
M chrome/browser/sync/protocol/sync_protocol_error.cc View 1 2 3 4 3 chunks +12 lines, -6 lines 0 comments Download
M chrome/browser/sync/sessions/session_state.h View 1 2 3 4 3 chunks +9 lines, -1 line 0 comments Download
M chrome/browser/sync/sessions/status_controller.h View 1 2 3 4 2 chunks +20 lines, -1 line 0 comments Download
M chrome/browser/sync/sessions/status_controller.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/sessions/sync_session.h View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/sync/sessions/sync_session.cc View 1 2 3 4 1 chunk +64 lines, -0 lines 0 comments Download
M chrome/browser/sync/sessions/test_util.cc View 1 2 3 4 1 chunk +6 lines, -11 lines 0 comments Download
M chrome/browser/sync/sync_ui_util.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test/integration/migration_errors_test.cc View 1 2 3 4 1 chunk +7 lines, -1 line 0 comments Download
M chrome/browser/sync/test/integration/performance/sync_timing_helper.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test/integration/single_client_apps_sync_test.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc View 1 2 3 4 6 chunks +7 lines, -7 lines 0 comments Download
M chrome/browser/sync/test/integration/single_client_extensions_sync_test.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test/integration/single_client_passwords_sync_test.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test/integration/single_client_preferences_sync_test.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test/integration/single_client_search_engines_sync_test.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test/integration/single_client_themes_sync_test.cc View 1 2 3 4 5 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/sync/test/integration/single_client_typed_urls_sync_test.cc View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/test/integration/sync_errors_test.cc View 1 2 3 4 4 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/sync/test/integration/sync_test.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test/integration/sync_test.cc View 1 2 3 4 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/sync/test/integration/two_client_apps_sync_test.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test/integration/two_client_extensions_sync_test.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc View 1 2 3 4 4 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test/integration/two_client_search_engines_sync_test.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test/integration/two_client_themes_sync_test.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 17 (0 generated)
rlarocque
I have no intention of committing this code as is. I'm just posting it here ...
9 years, 3 months ago (2011-09-09 00:58:28 UTC) #1
rlarocque
+ncarter Also: ping.
9 years, 3 months ago (2011-09-19 23:24:41 UTC) #2
tim (not reviewing)
http://codereview.chromium.org/7861013/diff/1/chrome/browser/sync/engine/sync_scheduler.cc File chrome/browser/sync/engine/sync_scheduler.cc (right): http://codereview.chromium.org/7861013/diff/1/chrome/browser/sync/engine/sync_scheduler.cc#newcode820 chrome/browser/sync/engine/sync_scheduler.cc:820: if (!old_job.session->WasUnableToMakeProgress()) { With the old "SyncerThread" this would ...
9 years, 3 months ago (2011-09-20 16:21:57 UTC) #3
rlarocque
http://codereview.chromium.org/7861013/diff/1/chrome/browser/sync/engine/sync_scheduler.cc File chrome/browser/sync/engine/sync_scheduler.cc (right): http://codereview.chromium.org/7861013/diff/1/chrome/browser/sync/engine/sync_scheduler.cc#newcode820 chrome/browser/sync/engine/sync_scheduler.cc:820: if (!old_job.session->WasUnableToMakeProgress()) { On 2011/09/20 16:21:57, timsteele wrote: > ...
9 years, 3 months ago (2011-09-20 20:10:03 UTC) #4
tim (not reviewing)
http://codereview.chromium.org/7861013/diff/1/chrome/browser/sync/engine/sync_scheduler.cc File chrome/browser/sync/engine/sync_scheduler.cc (right): http://codereview.chromium.org/7861013/diff/1/chrome/browser/sync/engine/sync_scheduler.cc#newcode820 chrome/browser/sync/engine/sync_scheduler.cc:820: if (!old_job.session->WasUnableToMakeProgress()) { On 2011/09/20 20:10:03, rlarocque wrote: > ...
9 years, 3 months ago (2011-09-20 20:32:12 UTC) #5
rlarocque
Something to keep in mind when reviewing ScheduleNextSync(). http://codereview.chromium.org/7861013/diff/1/chrome/browser/sync/engine/sync_scheduler.cc File chrome/browser/sync/engine/sync_scheduler.cc (right): http://codereview.chromium.org/7861013/diff/1/chrome/browser/sync/engine/sync_scheduler.cc#newcode855 chrome/browser/sync/engine/sync_scheduler.cc:855: } ...
9 years, 3 months ago (2011-09-20 20:35:20 UTC) #6
lipalani1
Looks good from my side. LGTM. Please wait for Tim's sign off as well. I ...
9 years, 3 months ago (2011-09-20 23:15:56 UTC) #7
lipalani1
Just added more explanation. http://codereview.chromium.org/7861013/diff/1/chrome/browser/sync/engine/sync_scheduler.cc File chrome/browser/sync/engine/sync_scheduler.cc (right): http://codereview.chromium.org/7861013/diff/1/chrome/browser/sync/engine/sync_scheduler.cc#newcode820 chrome/browser/sync/engine/sync_scheduler.cc:820: if (!old_job.session->WasUnableToMakeProgress()) { One more ...
9 years, 3 months ago (2011-09-20 23:18:09 UTC) #8
rlarocque
I've uploaded a new diff. This one is a bit more ambitious. It refactors the ...
9 years, 3 months ago (2011-09-21 18:44:42 UTC) #9
lipalani1
I agree with this change however prefer if it is another CL. http://codereview.chromium.org/7861013/diff/8002/chrome/browser/sync/engine/sync_scheduler.cc File chrome/browser/sync/engine/sync_scheduler.cc ...
9 years, 3 months ago (2011-09-22 20:22:46 UTC) #10
rlarocque
On 2011/09/22 20:22:46, lipalani1 wrote: > I agree with this change however prefer if it ...
9 years, 3 months ago (2011-09-22 23:34:51 UTC) #11
rlarocque
Uploaded a new patch. It has all the fix you love, with none of the ...
9 years, 3 months ago (2011-09-23 00:02:24 UTC) #12
rlarocque
Updated with MIGRATION_DONE fix.
9 years, 2 months ago (2011-09-27 20:02:49 UTC) #13
tim (not reviewing)
http://codereview.chromium.org/7861013/diff/17001/chrome/browser/sync/engine/sync_scheduler.cc File chrome/browser/sync/engine/sync_scheduler.cc (right): http://codereview.chromium.org/7861013/diff/17001/chrome/browser/sync/engine/sync_scheduler.cc#newcode820 chrome/browser/sync/engine/sync_scheduler.cc:820: if (!old_job.session->ExperiencedTransientError()) { We should add a comment here ...
9 years, 2 months ago (2011-09-27 21:20:04 UTC) #14
lipalani1
Tim & Richard - I have been discussing this with Richard for a while now. ...
9 years, 2 months ago (2011-09-27 21:30:39 UTC) #15
rlarocque
Replied to Tim's comments. The responses contain more questions than answers. http://codereview.chromium.org/7861013/diff/17001/chrome/browser/sync/engine/sync_scheduler.cc File chrome/browser/sync/engine/sync_scheduler.cc (right): ...
9 years, 2 months ago (2011-09-27 23:42:41 UTC) #16
rlarocque
9 years, 2 months ago (2011-10-05 23:45:39 UTC) #17
The last round of patches went around in e-mail because I had them nicely
organized in git.  This one isn't nearly as well organized, so I've squashed it
and posted the result here.  

This patch includes several changes:
* Rename and extend the SyncProtocolError struct to support network errors as
well.  Its new name is SyncOperationResult.
* Have PostClientToServerMessage return a SyncOperationResult.
* Store the latest SyncOperationResults for updates and commits in the session
status object.
* Use this information to determine whether or not the SyncScheduler should
retry its current job.

This change is not fully baked.  There's a lot of work involved in changing
SyncProtocolError, and I haven't finished it yet.  

Please let me know if you think I should continue with this approach, go back to
the previous approach (using an enum that duplicates a lot of the
SyncProtocolError states), or try something completely different.

Powered by Google App Engine
This is Rietveld 408576698