Skip to content

clear and release hang on a stuck load despite loadingTimeout #389

Description

@stasimus

Follow up from #369 (#369 (comment)).

With ExpiringCache.Config.loadingTimeout = 100ms and a getOrUpdate(IO.never) in flight, both clear and the release of the cache resource hang. clear unlinks the entries before awaiting the loads, so the cleanup routine never sees them, and on release the routine is already cancelled before the clear runs. The release finalizer is uncancelable, so it can't even be timed out from outside.

Currently documented as a limitation in Config.loadingTimeout, LoadingCache.clear and the README (60b3bf2).

To fix it the loading fiber needs to tell "removed" apart from "cleared", and the release finalizers need reordering so the timeout can still apply. Should come with a test: clear/release with a stuck load and loadingTimeout set.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions