Skip to content

expiresVariable() leaves a scheduled expiry even when the cache is empty #542

@facboy

Description

@facboy

i'm having a bit of trouble reproducing this in a test case, so i'll ask a question to see whether it's intended behaviour.

basic background, we're on JDK8 so i have to use a ScheduledExecutorService for the scheduler(). i don't want this to keep the JVM running so i have given it a corePoolSize of 0. i'm using variableExpiry, and the behaviour i'm seeing is that after the last (and in this particular instance, only) entry in the cache has expired out, the cache is leaving a scheduled PerformCleanup task for about 155m in the future. none of my expiry times has ever been anywhere near this value (it's either MAX_EXPIRY (about 150y)), or about 10 seconds after its last update.

is this intended behaviour? i haven't worked out exactly where it's getting this interval from (except that obviously it comes from the timerWheel).

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