New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 783436 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

[Sync] USS: Race condition when committing update for new item

Project Member Reported by pav...@chromium.org, Nov 9 2017

Issue description

In the following scenarion server id in commit is set incorrectly which triggers DCHECK in ProcessorEntityTracker::InitializeCommitRequestData:
- Model type creates local entity. Its entity data is cached in ProcessorEntityTracker.
- Syncer starts commit. Entity data is passed to ModelTypeWorker though ProcessorEntityTracker::InitializeCommitRequestData
- Model type modifies recently created entity. Its entity data with empty id is cached in ProcessorEntityTracker. 
- Commit response comes in with updated server id (SharedModelTypeProcessor::OnCommitCompleted). Server id is preserved in entity tracker's metadata, but cached EntityData still has empty id.
- Syncer starts next commit. SMTP::GetLocalChanges collects commit request with empty id with results in new item being created on the server.

The fix should be to update server id from metadata right before passing it to worker in GetLocalChanges. The problem is that currently EntityData is kept as ProtoValuePtr in ProcessorEntityTracker, the value is immutable. 
 

Comment 1 by pav...@chromium.org, Nov 15 2017

Status: Fixed (was: Started)
The issue was addressed by following CL: https://crrev.com/c/753983/3..4#message-eec8e1a1866be34bba7c5e30991853a8fa315e08

Sign in to add a comment