Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(9)

Issue 2751333007: [Sync] Try to fix race conditions in CookieJarMismatch. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
3 months, 1 week ago by skym
Modified:
3 months ago
Reviewers:
pavely
CC:
chromium-reviews, sync-reviews_chromium.org, Patrick Noland
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Sync] Try to fix race conditions in CookieJarMismatch. When we navigate to a URL in sync integration tests, sometimes, usually when this is the first navigation, we see two separate commits. The first has most of the data correctly set, but lacks a title. Later on the title is updated through a second commit. This test case has previously been updated in an attempt to resilient to this quirk, but it was not enough. In the flake in attached bug, what appeared to have happened was that the first navigation created two commits, but only the first one was needed to satisfy the WaitForURLOnServer check. Then we call OnGaiaAccountsInCookieUpdated but the affect is asynchronous. Before the posted task to update cookie information reaches the sync thread, but after the second histogram checker is created, a second commit from navigating to kURL1 executes and we get histogram data that we're not expecting, leading to a failure. I was not able to repro locally, so it is unclear if both of the following fixes were actually needed. Regardless, this should make us significantly more resilient to races and flakiness. First, changed the way blocking for sessions changes works, to only consider data that has a title set. When used in a way, this should force both commits to happen (if there are going to be two), and less likely the later will leak out. Second, added a callback to the mechanism that sets cookie information. This allows us to truly block until the sync thread has been updated. It is a significant amount of boilerplate for a very simple concept, unfortunately. BUG=689662 Review-Url: https://codereview.chromium.org/2751333007 Cr-Commit-Position: refs/heads/master@{#458773} Committed: https://chromium.googlesource.com/chromium/src/+/4d5e4f5dc10d0203717fbfcce22e546876b793ff

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -26 lines) Patch
M chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc View 3 chunks +21 lines, -13 lines 1 comment Download
M components/browser_sync/profile_sync_service.h View 1 chunk +7 lines, -0 lines 0 comments Download
M components/browser_sync/profile_sync_service.cc View 2 chunks +10 lines, -1 line 0 comments Download
M components/sync/driver/glue/sync_backend_host_core.h View 1 chunk +3 lines, -1 line 0 comments Download
M components/sync/driver/glue/sync_backend_host_core.cc View 1 chunk +7 lines, -1 line 0 comments Download
M components/sync/driver/glue/sync_backend_host_impl.h View 2 chunks +5 lines, -1 line 0 comments Download
M components/sync/driver/glue/sync_backend_host_impl.cc View 2 chunks +9 lines, -2 lines 0 comments Download
M components/sync/engine/fake_sync_engine.h View 1 chunk +3 lines, -1 line 0 comments Download
M components/sync/engine/fake_sync_engine.cc View 1 chunk +6 lines, -1 line 0 comments Download
M components/sync/engine/sync_engine.h View 1 chunk +3 lines, -1 line 0 comments Download
M components/sync/test/fake_server/fake_server_verifier.cc View 1 chunk +15 lines, -4 lines 0 comments Download
Trybot results:  android_arm64_dbg_recipe   cast_shell_android   android_n5x_swarming_rel   linux_chromium_chromeos_rel_ng   cast_shell_linux   android_compile_dbg   android_cronet   linux_chromium_chromeos_ozone_rel_ng   linux_chromium_rel_ng   mac_chromium_compile_dbg_ng   android_clang_dbg_recipe   chromeos_daisy_chromium_compile_only_ng   chromeos_amd64-generic_chromium_compile_only_ng   ios-device-xcode-clang   mac_chromium_rel_ng   chromium_presubmit   linux_chromium_tsan_rel_ng   win_clang   ios-simulator   ios-simulator-xcode-clang   win_chromium_x64_rel_ng   linux_android_rel_ng   win_chromium_rel_ng   linux_chromium_asan_rel_ng   ios-device   win_chromium_compile_dbg_ng   linux_chromium_compile_dbg_ng   win_chromium_rel_ng   linux_chromium_rel_ng   win_chromium_x64_rel_ng   win_clang   linux_android_rel_ng   linux_chromium_compile_dbg_ng   ios-device-xcode-clang   android_cronet   linux_chromium_rel_ng   android_compile_dbg   android_arm64_dbg_recipe   ios-simulator-xcode-clang   ios-device   ios-simulator   linux_chromium_chromeos_ozone_rel_ng   linux_chromium_tsan_rel_ng   linux_chromium_asan_rel_ng   win_chromium_rel_ng   chromeos_daisy_chromium_compile_only_ng   android_clang_dbg_recipe   android_n5x_swarming_rel   win_chromium_compile_dbg_ng   mac_chromium_compile_dbg_ng   cast_shell_linux   chromium_presubmit   mac_chromium_rel_ng   chromeos_amd64-generic_chromium_compile_only_ng   linux_chromium_chromeos_rel_ng   cast_shell_android 
Commit queue not available (can’t edit this change).

Messages

Total messages: 14 (9 generated)
skym
PTAL
3 months, 1 week ago (2017-03-17 23:33:51 UTC) #5
pavely
https://codereview.chromium.org/2751333007/diff/1/chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc File chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc (right): https://codereview.chromium.org/2751333007/diff/1/chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc#newcode379 chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc:379: run_loop.Run(); Waiting for values to arrive on sync thread ...
3 months, 1 week ago (2017-03-20 04:32:02 UTC) #8
pavely
lgtm
3 months ago (2017-03-22 15:32:01 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2751333007/1
3 months ago (2017-03-22 15:50:04 UTC) #11
commit-bot: I haz the power
3 months ago (2017-03-22 16:36:47 UTC) #14
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/4d5e4f5dc10d0203717fbfcce22e...
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld cb946e318