DescriptionConnect SimpleCache Backend active_entries_ more closely to Entry lifetime.
Entries remove themselves from their backend's |active_entries_| at two
distinct points in their lifetime; after a successful doom and on
destruction.
Entries are also added to |active_entries_| in one of two possible places;
early in opening/creating an entry from its key, and during iteration, after
successfully opening an entry from its hash alone.
We weren't carefully tracking this relationship, and so entries previously
would double remove themselves from the backend, which could create
races that could cause entries to not open. For instance, creating an entry,
dooming it, closing it, then creating a new entry with the same key could
race, and the doom's completion would remove the closing entry from
|active_entries_|, allowing a subsequent OpenEntry() to fail because it
found an half baked entry.
To avoid exposing the state of the backend to the entry, this patch
introduces an abstraction to Entry to allow observation of destruction. This
abstraction is then used to register the backend as entries are placed in
|active_entries_|.
R=jkarlin@chromium.org,ttuttle@chromium.org,pasko@chromium.org
BUG=317138, 404676
Committed: https://crrev.com/b02ee6e3d42dc4181251bbf4c4df0e3cc91994f5
Cr-Commit-Position: refs/heads/master@{#291728}
Patch Set 1 #Patch Set 2 : better #Patch Set 3 : lint #Patch Set 4 : using a scoper #Patch Set 5 : remove dead function #Patch Set 6 : remove inline destructor #
Total comments: 17
Patch Set 7 : began remediation #Patch Set 8 : cleanup comments #Patch Set 9 : one more comment #
Messages
Total messages: 10 (0 generated)
|