New issue
Advanced search Search tips

Issue 714143 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

LastModified for SimpleCache is wrong.

Project Member Reported by morlovich@chromium.org, Apr 21 2017

Issue description

It looks at the timestamp of the directory, not the cache files.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 24 2017

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

commit 2cac5e68544bf2f5fbaec00f62ffe0c6e7957598
Author: morlovich <morlovich@chromium.org>
Date: Mon Apr 24 17:40:16 2017

Fix incorrect computation of LastModified in SimpleCache,
avoid making useless syscalls[1]. Those particular ones seem to typically
be ultra cheap, but why do them when not needed?

The code was written to use simple_util::GetMTime because at the time it
was more precise than File::GetInfo when it came to timestamps; trouble
is, path_ is the cache directory, not the cache entry file (see e.g.
GetFilenameFromFileIndex), so this is the last modified timestamp
for the wrong thing; and as far as I can see File::GetInfo is as precise
these days.

As far as I can see w/grep and codesearch, nothing ultimately uses
DiskCache::Entry::GetLastModified() outside tests, so the biggest
impact was likely that SyncOpenEntryAge stat collected was bogus.

[1] Those were the looks up of info on the cache directory we saw when
 looking at syscall trace on Windows.

BUG= 714143 

Review-Url: https://codereview.chromium.org/2791493003
Cr-Commit-Position: refs/heads/master@{#466674}

[modify] https://crrev.com/2cac5e68544bf2f5fbaec00f62ffe0c6e7957598/net/disk_cache/backend_unittest.cc
[modify] https://crrev.com/2cac5e68544bf2f5fbaec00f62ffe0c6e7957598/net/disk_cache/simple/simple_synchronous_entry.cc

Status: Fixed (was: Started)
Looks fixed, and SyncOpenEntryAge data is very different.

Sign in to add a comment