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

Issue 897628 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocked on:
issue 902704



Sign in to add a comment

USS: Stopping a data type that was already stopping overrides the shutdown reason

Project Member Reported by feuunk@google.com, Oct 22

Issue description

This bug was pointed out by treib@ on crrev.com/1290149.

When ModelAssociationManager receives a stop call, it simply forwards the call to the DataTypeControllers, irrespective of whether they were already stopping. This overrides the ShutdownReason, which means that the MetadataFate gets overridden.

This means that if you disable sync, and then sync stops for any other reason (like browser shutdown), the metadata may be left behind.
 
Status: Available (was: Untriaged)
sync-triager edit: are you sure this is a P3?
Labels: -Pri-3 Pri-2
No :) 

Marking it P2 because this should trigger relatively rarely, and is not a regression.
Can you please elaborate the actual issue?

The original description doesn't seem very accurate, because ModelTypeController will *NOT* override, and instead will use the first. For sync metadata to leak, you'd need to stop-sync (without clearing metadata) and follow up (while stopping) with disable-sync (which should clear metadata). This doesn't seem very realistic.

For other related cases like multiple stop requests during startup, which is more likely because starting up is slower than stopping, ModelTypeController is quite smart: https://cs.chromium.org/chromium/src/components/sync/driver/model_type_controller.cc?l=255&rcl=63e884a4aa694069d5ab1e6b3431b7b1b12e6f23
Let me try to rephrase and give more details.

You're correct that MTC will use the first rather than the last reason, but it's still the same problem, no? I do agree that it's not very likely, but it's still something we don't handle.

Anyway, the more serious problem is receiving a CLEAR_DATA request when a MTC is already stopped:
E.g. the user turns off the Sync toggle on Android. Sync gets turned off, but we leave the metadata behind. Later (might be much later), the user signs out, resulting in a CLEAR_DATA request. Since the controller isn't running we just ignore it and leave the metadata around forever.
Blockedon: 902704
Cc: mastiz@chromium.org
Labels: Sync-Triaged
No updates here, but adding 902704 as dependency because it's very unlikely that we do any improvements to datatype controllers without getting rid of directory controllers first.

Sign in to add a comment