Skip to content

Add tolerance to cache metadata#375

Open
zipdoki wants to merge 3 commits into
mainfrom
feat/prune-metadata
Open

Add tolerance to cache metadata#375
zipdoki wants to merge 3 commits into
mainfrom
feat/prune-metadata

Conversation

@zipdoki

@zipdoki zipdoki commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a tolerance field to cache metadata, bounding the margin of concurrent delete/update operations absorbed during cache prune (on top of limit).

When absent, tolerance defaults to limit * 2 so older metadata deserializes with a concrete value. An explicit value is kept as-is; an explicit null is rejected.

Follows up on #322.

Changes

  • Add tolerance: Int to Cache, defaulting to limit * 2, validated as > 0
  • Add deserialization and V2 ↔ V3 conversion tests

How to Test

./gradlew :core:test :server:test

AI Assistance

  • This PR was written largely with AI assistance
  • Tool / model: Claude Code (Opus 4.8)

@zipdoki zipdoki self-assigned this Jun 6, 2026
@zipdoki zipdoki requested a review from em3s as a code owner June 6, 2026 13:51
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 6, 2026
@zipdoki zipdoki removed the request for review from em3s June 6, 2026 13:51
@dosubot dosubot Bot added the enhancement New feature or request label Jun 6, 2026
@em3s

em3s commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Could you add a comment explaining what limit and tolerance mean here? Also, please clarify how many items will be retained.

@zipdoki

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

Labels

enhancement New feature or request size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants