Trigger
This only affects filesystem-backed new_cache entries. It occurs when an entry has been accepted by the in-memory cache, but its deferred encoder later fails during FileCacheStrategy::after_all_stored.
For module cache, a representative trigger is cache: { type: persistent } with experiments.new_cache.module enabled, where a completed module build contains a dependency or other payload that cannot be serialized by the cache codec, for example process-local state or an unsupported dynamic cacheable type. Memory cache hits are unaffected because they do not encode values.
Current behavior
The idle write batch uses try_for_each over every pending entry. If encoding one entry fails, after_all_stored returns an error before writing the batch. Valid entries in the same batch are not persisted, and the pending batch can be retried and fail again.
Before the typed module-cache refactor, module cache encoded its own value before storing it and skipped that module entry on failure. Moving encoding behind the generic cache boundary removes that module-specific recovery path.
Expected behavior
FileCacheStrategy should encode pending entries independently: log and discard only an entry whose encoder fails, while continuing to persist the other valid entries, validator data, and metadata. This should be implemented as a generic filesystem-cache behavior, not as a module-cache exception.
Trigger
This only affects filesystem-backed new_cache entries. It occurs when an entry has been accepted by the in-memory cache, but its deferred encoder later fails during FileCacheStrategy::after_all_stored.
For module cache, a representative trigger is cache: { type: persistent } with experiments.new_cache.module enabled, where a completed module build contains a dependency or other payload that cannot be serialized by the cache codec, for example process-local state or an unsupported dynamic cacheable type. Memory cache hits are unaffected because they do not encode values.
Current behavior
The idle write batch uses try_for_each over every pending entry. If encoding one entry fails, after_all_stored returns an error before writing the batch. Valid entries in the same batch are not persisted, and the pending batch can be retried and fail again.
Before the typed module-cache refactor, module cache encoded its own value before storing it and skipped that module entry on failure. Moving encoding behind the generic cache boundary removes that module-specific recovery path.
Expected behavior
FileCacheStrategy should encode pending entries independently: log and discard only an entry whose encoder fails, while continuing to persist the other valid entries, validator data, and metadata. This should be implemented as a generic filesystem-cache behavior, not as a module-cache exception.