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

Issue 2826503002: [Sync] Act defensively when parent lookups fail on commit. (Closed)

Created:
3 years, 8 months ago by skym
Modified:
3 years, 8 months ago
Reviewers:
pavely
CC:
chromium-reviews, sync-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Sync] Act defensively when parent lookups fail on commit. When committing a bookmark (a hierarchical type), we follow parent links going upwards making sure that we also include all parents that are so far client side only. We will ultimately reverse this list so that we ensure parents always reach the server before children. What happened in the crash (see bug) this CL is trying to fix is that one of the parent look ups failed. Someone's parent id was a client id, and the directory didn't have a copy of it. In a simple world, this wouldn't happen, the bookmarks model should have sent the parent bookmark along (or even before) the child bookmark. Our working assumption is there's some race somewhere involving potentially multiple clients doing weird things like renaming, moving, and deleting folders, and re-associating. Somehow a constraint is broken, and on commit we have a child without a parent. Investigation into the root cause of this did not turn up anything easily, so instead we're changing the code to simply be more defensive and not crash in this circumstance. It would not be safe to send a child without a parent to the server, so our reaction is to skip committing the orphaned bookmarks. There are already several other cases that take the approach of not committing hierarchical things that are in a somewhat bad state, so this approach is somewhat consistent. The long term goal is to have all Bookmarks (the only hierarchical type) logic converted over to a USS implementation, and all of this code will be obsolete in the not terribly distant future anyways. BUG=711381 Review-Url: https://codereview.chromium.org/2826503002 Cr-Commit-Position: refs/heads/master@{#465033} Committed: https://chromium.googlesource.com/chromium/src/+/85ee7d9d45955be82e64b198a5b8901a16ea371a

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -8 lines) Patch
M components/sync/engine_impl/directory_commit_contribution_unittest.cc View 1 chunk +29 lines, -0 lines 0 comments Download
M components/sync/engine_impl/get_commit_ids.cc View 6 chunks +24 lines, -8 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 15 (11 generated)
skym
PTAL
3 years, 8 months ago (2017-04-17 18:15:48 UTC) #4
pavely
lgtm Could you add a CL description explaining that: - The issue is that committing ...
3 years, 8 months ago (2017-04-17 20:40:14 UTC) #7
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/2826503002/1
3 years, 8 months ago (2017-04-17 21:50:33 UTC) #12
commit-bot: I haz the power
3 years, 8 months ago (2017-04-17 21:54:40 UTC) #15
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/85ee7d9d45955be82e64b198a5b8...

Powered by Google App Engine
This is Rietveld 408576698