New issue
Advanced search Search tips

Issue 922100 link

Starred by 2 users

Issue metadata

Status: Started
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

SimpleCache: Trouble if Close reduces open count to 0 when there is an open queued.

Project Member Reported by morlovich@chromium.org, Jan 15

Issue description

Consider the following sequence of calls on a SimpleEntryImpl, done with the pending operation queue non-empty, and 1 external references:

1) OpenEntry
2) Close

Since the queue is non-empty, OpenEntry will queue OpenEntryInternal.
Close will reduce external reference count to 0, notice that, and queue a call to CloseInternal. 

When OpenEntryInternal runs, it increases external reference count to 1, and returns the entry to caller. 

When CloseInternal runs, it queues up a disk commit (if needed), and destruction of SimpleSynchronousEntry. When that finishes, CloseOperationComplete runs.

Debug builds will DCHECK fail here, due to external reference count (open_count_) being non-zero. Release builds will generally end up in 
STATE_UNINITIALIZED, meaning further operations will usually fail. This will be reflected in UMA under SimpleCache.ReadResult == READ_RESULT_BAD_STATE
and WriteResult2 == SIMPLE_ENTRY_WRITE_RESULT_BAD_STATE.


 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 16

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

commit 8927d3856ec52c2b2d8bee51ade89361bc07270b
Author: Maks Orlovich <morlovich@chromium.org>
Date: Wed Jan 16 02:51:30 2019

SimpleCache: fix pending reducing-to-zero-refcount close interleaved with open

(This showed up in a CL under development)

Bug: 922100

Change-Id: I870d80b6d7bda97c36b40bd1a711509d904bd6ae
Reviewed-on: https://chromium-review.googlesource.com/c/1410002
Reviewed-by: Matt Menke <mmenke@chromium.org>
Commit-Queue: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#623070}
[modify] https://crrev.com/8927d3856ec52c2b2d8bee51ade89361bc07270b/net/disk_cache/entry_unittest.cc
[modify] https://crrev.com/8927d3856ec52c2b2d8bee51ade89361bc07270b/net/disk_cache/simple/simple_entry_impl.cc

Sign in to add a comment