apache / apache/maven-build-cache-extension

[MBUILDCACHE-108] Remove local cache entries that have not been used during a configurable period of time

Open
#321 0 comments 0 reactions 0 assignees View on GitHub
enhancement priority:major
Dominant language
Java
Stars
163
Forks
77
Avg merge
1d 2h
Merged PRs (30d)
4

Description

**[Réda Housni Alaoui](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=ralaoui)** opened **[MBUILDCACHE-108](https://issues.apache.org/jira/browse/MBUILDCACHE-108?redirect=false)** and commented

As of today, the only mecanism of local cache cleaning is based on the maximum local cache entries to keep. e.g. If configured to 10, when reaching the threshold during a build, this extension will remove as many cache entries as needed to pass the number of entries under the treshold.

On a dev machine, this is good enough. But on a CI machine, where many builds of the same artifact gav could be running concurrently, this is risky. You could have an ongoing build removing the cache of another ongoing build.

I propose to add a new cleanup strategy based on the last cache entry usage datetime. e.g. If configured to 7 days, the cleanup process would remove any cache entry that hasn't been used for more than 7 days.

---
No further details from [MBUILDCACHE-108](https://issues.apache.org/jira/browse/MBUILDCACHE-108?redirect=false)

Contributor guide

No contributing guide indexed for this repository

Research direction

No files, tests, or entry points are named. Start by tracing the existing maximum-entry local-cache cleanup and its configuration, then determine how cache-entry usage timestamps are recorded. Done means a configurable age-based strategy removes entries unused beyond the configured period without relying on the entry-count threshold.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.