You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MemoryAdapter used a plain Hash with no synchronization,
causing race conditions in multi-threaded servers (Puma, Sidekiq).
fetch did a non-atomic exist?-then-write, allowing concurrent
threads to duplicate work or corrupt state.
Changes:
- Wrap all cache operations with Monitor#synchronize
- Make fetch atomic (inline key check + write under one lock)
- Add frozen_string_literal pragma
- Update tests to assert cache state directly instead of
mocking internal write calls
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments