New issue
Advanced search Search tips

Issue 754279 link

Starred by 3 users

Issue metadata

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



Sign in to add a comment

HostCache uses TimeTicks for expiration

Project Member Reported by lassey@chromium.org, Aug 10 2017

Issue description

I noticed that HostCache uses TimeTicks for the record expiration (https://cs.chromium.org/chromium/src/net/dns/host_cache.h?q=HostCache&sq=package:chromium&l=121). However, according to the comment in the header that defines TimeTicks, its behavior varies by platform and may stop when the machine/device is suspended (https://cs.chromium.org/chromium/src/base/time/time.h?q=TimeTicks&sq=package:chromium&l=20).

Its not clear that base::Time is strictly better either since it can change if the user resets their clock.
 

Comment 1 by mmenke@chromium.org, Aug 10 2017

I believe some platforms endeavor to continue incrementing TimeTicks even when coming out of suspend mode.  There are also other, even more frightening behaviors related to suspend mode, like TimeTicks::UnixEpoch() breaks if either TimeTicks stops increment, or the local clock is changed.

We could just flush the cache whenever we enter suspend mode, but that callback isn't available on all OSes (I think it's only available on Windows and Mac, and I think Windows is the platform where TimeTicks increases even when in suspend mode, though I could be wrong).

Comment 2 by mmenke@chromium.org, Aug 10 2017

It may even make sense to implement our own logic to try and fix TimeTicks to account for suspend mode ourselves.  This no doubt affects a lot of other consumers as well.

Comment 3 by lassey@chromium.org, Aug 11 2017

That is what I was thinking

Sign in to add a comment