Add setMaxBytesLocalDisk support for Ehcache 2 (support/ehcache2)#283
Merged
hazendaz merged 1 commit intosupport/ehcache2from Mar 9, 2026
Merged
Add setMaxBytesLocalDisk support for Ehcache 2 (support/ehcache2)#283hazendaz merged 1 commit intosupport/ehcache2from
hazendaz merged 1 commit intosupport/ehcache2from
Conversation
Copilot
AI
changed the title
[WIP] Refactor implementation for ehcache2 issue resolution
Add test coverage for maxBytesLocalDisk disk-overflow rebuild path
Mar 7, 2026
Copilot
AI
changed the title
Add test coverage for maxBytesLocalDisk disk-overflow rebuild path
Fix maxBytesLocalDisk not observed in Ehcache 2 adapter
Mar 7, 2026
Copilot
AI
changed the title
Fix maxBytesLocalDisk not observed in Ehcache 2 adapter
Add setMaxBytesLocalDisk support for Ehcache 2 (support/ehcache2)
Mar 8, 2026
fadf0a6 to
a765ff2
Compare
…ehcache2) Co-Authored-By: hazendaz <975267+hazendaz@users.noreply.github.com>
a765ff2 to
1eaa43d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
setMaxBytesLocalDiskwas absent from the Ehcache 2AbstractEhcacheCache, causing MyBatis to silently ignore<property name="maxBytesLocalDisk"/>configuration — disk usage grew without bound.Ehcache 2 throws
IllegalStateException: A Cache can't switch disk pool!when enabling the byte-based disk pool on a running cache, so a direct setter is not viable.Changes
AbstractEhcacheCache— addssetMaxBytesLocalDisk(long): snapshots TTI/TTL/heap/eviction-policy into a freshCacheConfigurationwith the byte limit applied, then replaces the live cache viaCacheManager. AddsrebuildCacheWith(CacheConfiguration)as a protected template method for subclass extension.EhBlockingCache— overridesrebuildCacheWithto re-wrap the replacement cache in aBlockingCachedecorator, preserving per-key locking semantics post-rebuild.EhcacheTest—shouldSetMaxBytesLocalDiskverifies config is applied and cache remains functional;shouldSupportDiskOverflowsets heap=1, disk=10 MB, writes 3 entries, and asserts all 3 are retrievable (proving the disk tier is live after rebuild).EhBlockingCacheTest— mirrors both tests for the blocking-cache path, confirming theBlockingCachedecorator survives the rebuild.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/graphql/usr/bin/gh gh pr view 283 --json baseRefName,headRefName,title(http block)/usr/bin/gh gh auth status(http block)https://api.github.com/repos/mybatis/ehcache-cache/usr/bin/curl curl -s --max-time 10 REDACTED -H Authorization: ****** ndor/bin/git(http block)/usr/bin/curl curl -s --max-time 10 REDACTED -H Authorization: ******(http block)https://api.github.com/repos/mybatis/ehcache-cache/contents/pom.xml/usr/bin/curl curl -s --max-time 10 -o /dev/null -w %{http_code} REDACTED -H Authorization: ******(http block)https://api.github.com/repos/mybatis/ehcache-cache/pulls/283/usr/bin/curl curl -s -X PATCH -H Authorization: token ****** -H Accept: application/vnd.github.v3+json -H Content-Type: application/json REDACTED -d {"base": "support/ehcache2"}(http block)/usr/bin/curl curl -v -X PATCH -H Authorization: ****** -H Accept: application/vnd.github+json -H X-GitHub-Api-Version: 2022-11-28 REDACTED -d {"base":"support/ehcache2","draft":false}(http block)/usr/bin/curl curl -s -X PATCH -H Authorization: ****** -H Accept: application/vnd.github+json -H X-GitHub-Api-Version: 2022-11-28 --max-time 15 REDACTED -d {"base":"support/ehcache2","draft":false}(http block)If you need me to access, download, or install something from one of these locations, you can either:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.