Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Only query cache's reserved files once per cleanup

    • -0
    • +41
    ./gradle/cache/internal/NonReservedFileFilterTest.groovy
  1. … 3 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.

    • -0
    • +81
    ./gradle/cache/internal/CompositeCleanupActionTest.groovy
  1. … 9 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.

    • -68
    • +0
    ./gradle/cache/internal/IndexedCacheBackedFileAccessJournalTest.groovy
  1. … 30 more files in changeset.
Let `CacheKeyBuilder` accept `HashCode` components

Signed-off-by: Rodrigo B. de Oliveira <rodrigo@gradle.com>

  1. … 2 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
    • +68
    ./gradle/cache/internal/IndexedCacheBackedFileAccessJournalTest.groovy
    • -0
    • +72
    ./gradle/cache/internal/LeastRecentlyUsedCacheCleanupTest.groovy
  1. … 28 more files in changeset.
Return Collection instead of File[]

  1. … 4 more files in changeset.
Polish and document new top-level types

    • -0
    • +60
    ./gradle/cache/internal/SingleDepthFilesFinderTest.groovy
  1. … 16 more files in changeset.
Clean up least recently used entries in artifacts file store

The files in the artifacts file store cache are now automatically

cleaned up based on a least recently used strategy. The structure in

the cache is as follows:

- modules-2

- files-2.1

- groupId

- artifactId

- version

- hash1 (*)

- file

- hash2 (*)

- file

The cache now keeps track of files accessed inside the marked hash

directories. The cleanup action then deletes all such files that have

not been accessed in the last 30 days.

    • -0
    • +60
    ./gradle/cache/internal/SingleDepthDescendantsFileFinderTest.groovy
  1. … 14 more files in changeset.
Clean up least recently used entries in external resources file store

The files in the external resources file store cache are now

automatically cleaned up based on a least recently used strategy. The

structure in the cache is as follows:

- modules-2

- resources-2.1

- 0

- hash 1 (*)

- hash 2 (*)

- ...

- ...

The cache now keeps track of files accessed inside the marked hash

directories. The cleanup action then deletes all such files that have

not been accessed in the last 30 days.

  1. … 27 more files in changeset.
Handle missing cache.properties

Prior to this commit, the check whether initialization is required

threw a `FileNotFoundException` when cache.properties did not exist.

Since the file is only created when `DefaultPersistentDirectoryCache`

is used instead of `DefaultPersistentDirectoryStore`, this can happen

when re-using an existing cache directory that used to be accessed

using the latter but from now on will be accessed using the former.

For instance, when adding a cleanup action, `DefaultCacheFactory` will

no longer return a plain store but a Ccache.

The missing properties file will now be ignored when the cache is not

using any properties. Otherwise, it will cause the cache to be

re-initialized, i.e. all contained files will be deleted.

In addition, this commit fixes a `NullPointerException` that occurred

when a property was present in the cache's new properties but missing

in the existing cache.properties file.

  1. … 1 more file in changeset.
Clean up least recently used entries in artifact transforms cache

The files in the transforms cache are now automatically cleaned up based

on a least recently used strategy. The structure in the cache is as

follows:

- files-1.1

- artifact-a

- hash 1 (*)

- hash 1.1

- ...

- hash 2 (*)

- ...

- ...

- metadata-1.1

The cache now keeps track of files accessed inside the first hash (*)

level by touching the corresponding directory. The cleanup action then

deletes all such directories that have not been accessed in the last 7

days.

Issue: #1085

    • -0
    • +44
    ./gradle/cache/internal/NonReservedCacheFileFilterTest.groovy
  1. … 7 more files in changeset.
Prevent creatig byte array copies when hashing hash codes

Should reduce garbage creation a little.

  1. … 8 more files in changeset.
Use logical equality to determine whether a cached value needs to be updated.

  1. … 2 more files in changeset.
Use age-based strategy to clean local build cache

Signed-off-by: Lóránt Pintér <lorant@gradle.com>

  1. … 12 more files in changeset.
Clean up partial files after errors and during GC

Previously '.part' files were left behind after local cache failures, because we expected they would be useful in debugging these cases. That never happened, so we are now removing them even if there's an error, and also during garbage collection.

Signed-off-by: Lóránt Pintér <lorant@gradle.com>

  1. … 5 more files in changeset.
Detangle PersistentCache cleanup action dependencies

- Introduce a new CleanupAction

- Decorate CleanupActions via CleanupActionFactory

- Remove the special case for keeping .part files

- Ask PersistentCache for "reserved" files, these files should never be cleaned up

- Reduce the number of build operations produced when cleaning a PersistentCache

Signed-off-by: Sterling Greene <sterling@gradle.com>

  1. … 19 more files in changeset.
Add coverage for cleaning up VCS checkouts

Signed-off-by: Sterling Greene <sterling@gradle.com>

  1. … 2 more files in changeset.
Add persistent cache cleanup action that deletes files older than a given age

Signed-off-by: Sterling Greene <sterling@gradle.com>

    • -0
    • +71
    ./gradle/cache/internal/AbstractCacheCleanupTest.groovy
    • -0
    • +72
    ./gradle/cache/internal/FixedAgeOldestCacheCleanupTest.groovy
  1. … 5 more files in changeset.
Use our own hashing architecture, take 2 (#2817)

This replaces Guava's hashing. We need this for two reasons:

- it allows the addition of custom hash functions, like BLAKE2b which would not be possible with Guava's closed design

- it fixes a few performance issues that Guava only fixes in version 20 (which we can't upgrade to right now, because we still need to support Java 5 in places)

  1. … 159 more files in changeset.
Restart timer if the lock owner changes

If many processes fight and wait for the same lock, the timeout in one

process could be triggered, because it is "last in line". All the times

others hold the lock are added up for the timeout.

This change resets the timeout as soon as the lock owner changes.

  1. … 2 more files in changeset.
Provide an empty contended action instead of null

This contention handling is already active for exclusive locks, but

without an action it is ignoring requests from other parties.

With this, it sends confirmation that the request was received

and that lock releasing is in progress. Although the release itself

is not performed by the contended action, but manually after the

lock is no longer needed (which is the contract for exclusive locks).

    • -4
    • +4
    ./gradle/cache/internal/FixedExclusiveModeCrossProcessCacheAccessTest.groovy
  1. … 1 more file in changeset.
Start whenContented action before waiting for the lock

The action is now also responsible for receiving confirmation that the

lock is in the process of being released.

    • -44
    • +71
    ./gradle/cache/internal/LockOnDemandCrossProcessCacheAccessTest.groovy
  1. … 3 more files in changeset.
Fix classycle issue

+review REVIEW-6562

  1. … 5 more files in changeset.
Move org.gradle.api.internal.cache to persistent-cache project

+review REVIEW-6562

    • -0
    • +46
    ./gradle/cache/internal/MapBackedCacheTest.groovy
  1. … 85 more files in changeset.
Move org.gradle.cache.internal to persistent-cache project

+review REVIEW-6562

    • -0
    • +545
    ./gradle/cache/internal/AbstractFileLockManagerTest.groovy
    • -0
    • +201
    ./gradle/cache/internal/CacheAccessWorkerTest.groovy
    • -0
    • +729
    ./gradle/cache/internal/DefaultCacheAccessTest.groovy
    • -0
    • +223
    ./gradle/cache/internal/DefaultCacheFactoryTest.groovy
    • -0
    • +150
    ./gradle/cache/internal/DefaultCacheKeyBuilderTest.groovy
    • -0
    • +126
    ./gradle/cache/internal/DefaultCacheRepositoryTest.groovy
    • -0
    • +93
    ./gradle/cache/internal/DefaultFileLockManagerContentionTest.groovy
    • -0
    • +55
    ./gradle/cache/internal/DefaultFileLockManagerWithCrossVersionProtocolTest.groovy
    • -0
    • +282
    ./gradle/cache/internal/DefaultFileLockManagerWithNewProtocolTest.groovy
    • -0
    • +58
    ./gradle/cache/internal/DefaultPersistentDirectoryCacheSpec.groovy
    • -0
    • +290
    ./gradle/cache/internal/DefaultPersistentDirectoryCacheTest.groovy
    • -0
    • +61
    ./gradle/cache/internal/DefaultPersistentDirectoryStoreConcurrencyTest.groovy
    • -0
    • +123
    ./gradle/cache/internal/DefaultPersistentDirectoryStoreTest.groovy
    • -0
    • +40
    ./gradle/cache/internal/DefaultProcessMetaDataProviderTest.groovy
    • -0
    • +99
    ./gradle/cache/internal/FileLockCommunicatorTest.groovy
  1. … 170 more files in changeset.
Only send ping for lock release once

  1. … 5 more files in changeset.
Improve block pointer error handling

Don't throw a vanilla IllegalArgumentException, but

a CacheCorruptedException. This ensures that the layers

further up can discard the cache and recreate the value.

    • -0
    • +30
    ./gradle/cache/internal/btree/BlockPointerTest.groovy
  1. … 1 more file in changeset.