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

Issue 2568543003: [Sync] Actively guard against provider being cleared in DeviceInfoSyncBridge. (Closed)

Created:
4 years ago by skym
Modified:
4 years ago
Reviewers:
maxbogue
CC:
chromium-reviews, sync-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Sync] Actively guard against provider being cleared in DeviceInfoSyncBridge. When a user signs out and Sync starts to shut down, we immediately clear the LocalDeviceInfoProvider. Many methods in DeviceInfoSyncBridge depend on being able to access information in the provider, and can crash at this point. The bridge should be disabled momentarily, but this will require threads hops UI->Sync->UI. Meanwhile, various other posted tasks can call into the bridge and hit this race condition. We were previously guarding against this scenario when the pulse timer would fire, but we were not guarding against processor's Merge/Apply calls or ModelTypeStore async initialization. I've added nullptr checks to all async entry points that mostly no-op when they detect this scenario. One slight hiccup is that the bridge currently leaves the pulse timer running even when disabled. My intention is that this change will be merged back into M56 so I wanted to keep this CL as small as possible. When crbug.com/672600 is addressed I think it will make the most sense to disable the pulse timer while disabled, since it should always be re-enabled with an accurate timer when things are working again. Additionally, some state tracking such as has_provider_initialized_ should probably just be removed at this point. This should be caught in crbug.com/659263 BUG=672534 Committed: https://crrev.com/24268f797538e6add4338602ff1ebd78affe2648 Cr-Commit-Position: refs/heads/master@{#437902}

Patch Set 1 #

Patch Set 2 : Updated comments slightly. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -3 lines) Patch
M components/sync/device_info/device_info_sync_bridge.cc View 1 6 chunks +26 lines, -3 lines 0 comments Download
M components/sync/device_info/device_info_sync_bridge_unittest.cc View 5 chunks +50 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 15 (10 generated)
skym
PTAL
4 years ago (2016-12-09 20:48:53 UTC) #5
maxbogue
lgtm, but I think we should really consider forcing consumers of DeviceInfo to cache it ...
4 years ago (2016-12-10 00:28:29 UTC) #8
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/2568543003/20001
4 years ago (2016-12-12 17:00:07 UTC) #10
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years ago (2016-12-12 18:22:39 UTC) #13
commit-bot: I haz the power
4 years ago (2016-12-12 18:35:15 UTC) #15
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/24268f797538e6add4338602ff1ebd78affe2648
Cr-Commit-Position: refs/heads/master@{#437902}

Powered by Google App Engine
This is Rietveld 408576698