Skip to content

JCache interface ExpireAfterAccess is not honored if statistics is not enabled #158

@isen-ng

Description

@isen-ng

in method
com.github.benmanes.caffeine.jcache.CacheProxy::setAccessExpirationTime(Expirable<?> expirable, long currentTimeMS)

Line 1077: currentTimeMS = ticker.read(); is wrong.
ticker.read(); returns the current time in nano seconds resulting in the getExpiryForAccess feature not being honored.

The correct line should read
currentTimeMS = nanosToMillis(ticker.read());

The current workaround is to enable statistics, which pre-populates currentTimeMS from a correct value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions