Releases: LegionIO/legion-cache
Releases · LegionIO/legion-cache
v1.4.2
v1.4.1
Fixed
- AsyncWriter TOCTOU race condition in enqueue (capture local executor reference)
- Reconnector deadlock on stop (release mutex before thread.join)
- Reconnector NoMethodError on successful reconnect (AtomicFixnum reset)
- Missing
require 'concurrent'in reconnector.rb - Redis cluster flush now passes auth/TLS credentials to per-node connections
- Async writer drains before pool close on shutdown
- Serialization applied to mget/mset_sync (was only on set_sync/get)
- Binary encoding forced before serialization prefix checks
Added
- Automatic failback to Local tier when shared cache is disabled or disconnected (configurable via
failback_to_local: true) mget/msetmethods on Memory adapter for interface consistency- Public
poolaccessor onLegion::Cache(replaces direct@clientaccess) failed_countcounter in AsyncWriter stats (async_failedin stats hash)reconnect_shared!raising method for reconnector connect_block- End-to-end lifecycle integration test (shared fail -> local failback -> reconnect)
Changed
- Helper and Cacheable use
async: falsefor read-after-write consistency - AsyncWriter and Reconnector are tier-aware (
settings_key:parameter,:cache_localfor local tier) - Redis driver
pool_sizeresolved from settings (was hardcoded to 20) - Pool checkout timeout separated from operation timeout (new
pool_checkout_timeoutsetting) - Reconnector starts on any shared failure (even when local fallback succeeds)
setupguarded byenabled?check- State flags (
@connected,@using_local,@using_memory) refactored toConcurrent::AtomicBoolean - Reconnector
@stop_signalrefactored toConcurrent::AtomicBoolean RedisHashuses publicpoolaccessor instead ofinstance_variable_get(:@client)
v1.3.22
Fixed
- Default
serversno longer pre-computed at require time with stale driver port; resolves Redis connecting to127.0.0.1:11211(memcached default) instead of user-configured host
v1.3.21
Fixed
- Preserve
fetchblock behavior across shared, local, memory, and Redis cache paths; local-cache failures now fall back to the in-process cache and cachedfalsevalues are retained correctly - Move shared adapter selection to runtime setup/client calls, register cache defaults through
Legion::Cache::Settings, and normalize IPv4/hostname/IPv6 server addresses consistently - Restrict Redis hash/sorted-set helpers to the actual Redis backend and enforce documented TTL behavior for helper batch writes
- Make the default
bundle exec rspecsuite hermetic by excluding service-backed integration specs unlessRUN_INTEGRATION_SPECS=1
Changed
- Uplift cache logging internals to
Legion::Logging::Helper, replacing direct logger calls with helper-providedlogusage across cache runtime modules - Route rescued cache adapter/helper/setup failures through
handle_exceptionand expand runtimeinfo/debug/errorcoverage for shared, local, memory, pool, and RedisHash flows - Require
legion-logging >= 1.5.0at runtime so helper exception handling is always available
v1.3.20
Fixed
- Forward
timeoutsetting to::Redis.new— was silently using redis gem's 1.0s default instead of configured 5s, causing spurious timeouts on service mesh connections - Forward
timeoutto::Redis.newin cluster mode path as well
Changed
- Increase
reconnect_attemptsfrom1to[0, 0.5, 1](shared) /[0, 0.25, 0.5](local) — 3 retries with escalating backoff instead of 1 instant retry, improving resilience for service mesh and remote Redis connections
v1.3.19
Added
cache_mget/cache_mset(andlocal_cache_mget/local_cache_mset) onHelpermixin — delegates to Redis batch ops, falls back to sequential get/set on Memcached (closes #3)cache_hset,cache_hgetall,cache_hdel,cache_zadd,cache_zrangebyscore,cache_zrem,cache_expireonHelpermixin — delegates toRedisHashwith namespace prefixing; hash ops fall back to JSON-serialized Memcached values, sorted-set ops raiseNotImplementedError, expire is a no-op on Memcached (closes #4)
v1.3.18
Added
- Layered TTL resolution in Helper (per-call → LEX override → Settings → FALLBACK_TTL)
cache_default_ttl/local_cache_default_ttl— LEX-overridable default TTL methodscache_exist?/local_cache_exist?— key existence checkscache_connected?/local_cache_connected?— connection status helperscache_pool_size/cache_pool_available— pool info (shared tier)local_cache_pool_size/local_cache_pool_available— pool info (local tier)phi:keyword argument oncache_set/local_cache_setfor PHI TTL enforcementdefault_ttlkey in Settings.default and Settings.local (defaults to 60)
v1.3.17
Added
Legion::Cache::RedisHashmodule: Redis hash and sorted-set operations (hset,hgetall,hdel,zadd,zrangebyscore,zrem,expire) withredis_available?guard and safe defaults when Redis is not connected- Auto-required from
legion/cache.rbalongside the existing Redis adapter
v1.3.16
Release v1.3.16
v1.3.15
Added
- PHI-aware TTL enforcement:
Cache.setacceptsphi: truekeyword option; TTL is capped atcache.compliance.phi_max_ttl(default 3600s) when set Legion::Cache.phi_max_ttl— readscache.compliance.phi_max_ttlfrom settings with 3600s defaultLegion::Cache.enforce_phi_ttl(ttl, phi:)— public helper for PHI TTL cap logic