New issue
Advanced search Search tips

Issue 680322 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Make CachingHostInfoStore.commit more robust to concurrent access

Project Member Reported by pprabhu@chromium.org, Jan 12 2017

Issue description

We have concurrent access to hosts' labels and attributes in the system.
We should make this access safe via CachingHostInfoStore.

The idea is:

- Each HostInfo contains a private copy of the "initial state" when it was returned from CachingHostInfoStore.
- Concrete implementations of CachingHostInfoStore are expected to correctly use the "diff" from the commited HostInfo object to update the backing store.

(I don't see a way to enforce this directly from CachingHostInfoStore without exposing the details of HostInfo between CachingHostInfoStore and its concrete implementations)
 
Rather than using the diff to update the backing store, implementations should reject the commit if the current state doesn't match the caching state.

This is because we may not be able to correctly infer the change based on the diff.

Example:

 A gets hostinfo
 B adds foo label
 A checks if foo exists (it doesn't for its hostinfo), adds spam label
 We incorrectly infer that A wanted to add spam label
 Now hostinfo is in illegal state (both spam and foo labels)

 A gets hostinfo
 B adds foo label
 A checks if foo is missing, adds spam label
 We notice that hostinfo has been changed, tell A to retry
 A gets new hostinfo
 A checks if foo is missing, finds foo, does nothing

In other words, we want to implement transactions =(.

We may decide that the probability and damage of such race conditions isn't worth implementing this correctly, but this assumption has to be re-evaluated for each new piece of label or attribute logic that's added in the future, which accrues continuous interest.

Comment 2 by autumn@chromium.org, Jan 17 2017

Labels: -current-issue
Status: Archived (was: Assigned)
Bulk closing Infra>Client>ChromeOS issues untouched in over a year.

Sign in to add a comment