LeastRecentlyUsedCacheCleanupTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Report deleted and skipped cache entries

This commit introduces `CleanupProgressMonitor` and a default

`ProgressLogger`-based implementation that tracks the total number of

deleted and skipped cache entries. `CleanupAction.clean()` now takes a

monitor as an additional argument. `DefaultPersistentDirectoryStore`

creates the default implementation and passes it to its `CleanupAction`.

    • -2
    • +4
    ./LeastRecentlyUsedCacheCleanupTest.groovy
  1. … 14 more files in changeset.
Make cache cleanup non-incremental

    • -2
    • +2
    ./LeastRecentlyUsedCacheCleanupTest.groovy
  1. … 14 more files in changeset.
Delete access times for deleted files from journal

When a file is deleted by the LeastRecentlyUsedCacheCleanup action, the

corresponding entry is now removed from the used FileAccessTimeJournal

in order to avoid storing obsolete entries that would never get removed.

    • -1
    • +4
    ./LeastRecentlyUsedCacheCleanupTest.groovy
  1. … 7 more files in changeset.
Use separate cache for file access time journal

Storing a file access time journal inside each cache causes a lot of

contention in particular with caches that require a lot of exclusive

access like the artifact cache.

Instead, a new `journal-1` cache that is managed by a user-home-scoped

service is now used to keep track of file access times for all caches

that want to use it.

    • -2
    • +1
    ./LeastRecentlyUsedCacheCleanupTest.groovy
  1. … 23 more files in changeset.
Enable incremental cache cleanup

Instead of computing the complete list of eligible files at once,

SingleDepthFileFinder now returns an Iterable that creates an

Iterator that will incrementally walk the file tree.

In addition, the CleanupAction.clean() operation now takes a

CountdownTimer and implementations periodically check whether the timer

has expired. If so, the current cleanup will be aborted.

DefaultPersistentDirectoryCache now uses a timeout of 20 seconds which

is well below the file locking timeout of 60 seconds.

The marker file (gc.properties) will only be updated if the complete

cleanup was able to finish without expiring the timeout.

    • -21
    • +36
    ./LeastRecentlyUsedCacheCleanupTest.groovy
  1. … 13 more files in changeset.
Write access time asynchronously, read synchronously

File access times are now written asynchronously while the cache is

being used. When it's about to be closed, they are now read

synchronously from the cleanup action because the cache access worker

has then already been stopped.

    • -2
    • +3
    ./LeastRecentlyUsedCacheCleanupTest.groovy
  1. … 31 more files in changeset.
Track artifact cache file access in PersistentIndexedCache

This commit introduces the `FileAccessJournal` interface and provides

two implementations:

ModificationTimeFileAccessJournal::

Reads and sets `File.lastModified()`.

IndexedCacheBackedFileAccessJournal::

Uses a PersistentIndexedCache to store the access timestamp.

The latter is now used in DefaultCacheLockingManager for the artifact

cache. All other PersistentCaches still use the former.

    • -0
    • +72
    ./LeastRecentlyUsedCacheCleanupTest.groovy
  1. … 30 more files in changeset.