Release unused file buffers for empty artifacts

This commit is contained in:
2026-10-09 01:52:06 +00:00
parent 389ef26db3
commit ea6c7d5f0f
5 changed files with 34 additions and 8 deletions

View File

@@ -131,9 +131,10 @@ fallback.
Regular files are read synchronously in bounded chunks. The opened file's size
is only an initial-capacity hint, capped at 1 MiB; reads continue to EOF, and
the returned body determines artifact size and hash. If an overreported hint
leaves more than twice the actual body length unused, the completed body is
copied to release the excess backing storage. Cancellation is checked before
opening, before and after every read, and before publishing the artifact, so a
leaves unused capacity greater than the actual body length, the completed body
is copied to release the excess backing storage, including when the body is
empty. Cancellation is checked before opening, before and after every read,
and before publishing the artifact, so a
canceled read never publishes partial content. The ordinary reader does not
detach file reads into background goroutines.