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

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

Created:
3 years, 9 months ago by skym
Modified:
3 years, 9 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

Messages

Total messages: 14 (9 generated)
skym
PTAL
3 years, 9 months 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 years, 9 months ago (2017-03-20 04:32:02 UTC) #8
pavely
lgtm
3 years, 9 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 years, 9 months ago (2017-03-22 15:50:04 UTC) #11
commit-bot: I haz the power
3 years, 9 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...

Powered by Google App Engine
This is Rietveld 408576698