Files
sbt/notes/2.0.0/cache-write-serialization-no-io.md
T
BrianHotoppandClaude Opus 4.8 5a8cc7c9c2 [2.x] fix: Keep file I/O out of cache-write serialization (#9496)
putBlobsIfNeeded reads each blob's hash and size once, up front, and
returns only plain HashedVirtualFileRef values, so serializing an ActionResult
(disk, in-memory, or remote store) performs no file I/O and nothing re-stats a
blob after its CAS entry is written: a file vanishing once stored no longer
prevents the write, and I/O errors on an output file surface upfront at blob
storage time rather than mid-serialization.

Fixes #9349

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-24 13:51:33 -04:00

16 lines
808 B
Markdown

### Cache-write serialization no longer performs file I/O
Serializing a task's result for the action cache re-read the size of every
referenced file at write time, so a file vanishing between the task completing
and the cache write (for example when two overlapping evaluations of the same
task race the jar-to-CAS-symlink swap) made an otherwise successful task's
cache write throw an intermittent `sjsonnew.SerializationException: error
while writing the field outputFiles`. Each stored output reference is now
materialized once, before its blob is stored, so the cache write succeeds even
if the file vanishes afterwards, and I/O errors on an output file surface
upfront at blob storage time rather than mid-serialization.
This addresses [#9349][i9349].
[i9349]: https://github.com/sbt/sbt/issues/9349