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

Issue 880080 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 10
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

DCHECK(!CanConfigureDataTypes()) in ProfileSyncService::GetTransportState

Project Member Reported by treib@chromium.org, Sep 3

Issue description

(Originally reported in https://bugs.chromium.org/p/chromium/issues/detail?id=879503#c4)

The following DCHECK can fire if data type configuration fails:

[9616:9616:0831/170337.544315:FATAL:profile_sync_service.cc(854)] Check failed: !CanConfigureDataTypes(). 
#0 0x7fb378ce94ec base::debug::StackTrace::StackTrace()
#1 0x7fb378c151ab logging::LogMessage::~LogMessage()
#2 0x55bd2bd66926 browser_sync::ProfileSyncService::GetTransportState()
#3 0x55bd2b40c93d syncer::SyncService::IsSyncActive()
#4 0x55bd2c29cb86 RecentTabsSubMenuModel::BuildTabsFromOtherDevices()
#5 0x55bd2c29dd06 RecentTabsSubMenuModel::OnForeignSessionUpdated()
#6 0x55bd2bd69596 browser_sync::ProfileSyncService::OnConfigureDone()
#7 0x55bd2bd3625b syncer::DataTypeManagerImpl::NotifyDone()
#8 0x55bd2bd377ee syncer::DataTypeManagerImpl::Abort()
#9 0x55bd2bd374e9 syncer::DataTypeManagerImpl::OnModelAssociationDone()
#10 0x55bd2bd3c8ce syncer::ModelAssociationManager::ModelAssociationDone()
#11 0x55bd2bd3ce11 syncer::ModelAssociationManager::TypeStartCallback()

The problem is that ProfileSyncService::OnConfigureDone calls OnSyncConfigurationCompleted on its observers, a) even if the configuration failed (which is questionable), and b) before updating its own state, i.e. handling the error. If one of those observer callbacks triggers a call to GetTransportState, then this DCHECK will trigger due to the (temporary) inconsistent state.

Possible solutions:
1) Don't call OnSyncConfigurationCompleted if it didn't succeed.
2) Call OnSyncConfigurationCompleted only after handling the error.
3) Remove the DCHECK.

The intended semantics of OnSyncConfigurationCompleted aren't really clear to me, so I don't know yet whether 1) makes sense. 2) should definitely be possible. I wouldn't like to remove the DCHECK because of this corner case.
 
Status: Started (was: Assigned)
Project Member

Comment 2 by bugdroid1@chromium.org, Sep 10

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/215a813849f3c217bcd7afe94512e2e11363b5be

commit 215a813849f3c217bcd7afe94512e2e11363b5be
Author: Marc Treib <treib@chromium.org>
Date: Mon Sep 10 09:47:11 2018

ProfileSyncService: Notify of OnSyncConfigurationCompleted only on success

On a configuration failure, PSS is temporarily in an inconsistent state
until the error is processed (by calling OnUnrecoverableErrorImpl). If we
call an observer during that time, and the observer calls
PSS::GetTransportState, then that could trigger a DCHECK.

It's arguable whether calling OnSyncConfigurationCompleted on an error
even makes sense. It looks like none of the clients can do anything useful
in that case anyway. So let's just not call them. If they're interested in
the error, then they should listen for OnStateChanged instead.

Bug:  880080 
Change-Id: If4179cd530f3e625bd53de466c059e051b36f42d
Reviewed-on: https://chromium-review.googlesource.com/1210083
Reviewed-by: Mikel Astiz <mastiz@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589869}
[modify] https://crrev.com/215a813849f3c217bcd7afe94512e2e11363b5be/components/browser_sync/profile_sync_service.cc

Status: Fixed (was: Started)
The above CL implements solution 1 from #0. Let's hope that resolves the DCHECKs.

Sign in to add a comment