Release unused file buffers for empty artifacts
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Implementation Review Remediation
|
||||
|
||||
Status: One computational-efficiency finding awaits remediation. Earlier
|
||||
findings below remain resolved.
|
||||
Status: All recorded findings have been resolved in separate remediation units.
|
||||
|
||||
## Computational Efficiency Review
|
||||
|
||||
@@ -10,7 +9,16 @@ Review baseline: `8a5c0de`, compared with planning commit `3fde1f6`, the
|
||||
|
||||
### Finding 1 — Release A Stale File Reservation For An Empty Body (P3)
|
||||
|
||||
**Status: Open.**
|
||||
**Status: Resolved.** Completed empty bodies now release stale file-size
|
||||
reservations using the existing compaction path. The stale-size table covers
|
||||
empty content, metadata, and hashes; the retained-artifact benchmark includes
|
||||
an empty-body fixture without enforcing capacity or allocation thresholds.
|
||||
Three offline, one-iteration samples for four retained empty artifacts changed
|
||||
from 4,194,928–4,194,976 retained bytes to 624–640 bytes. Initial reservation
|
||||
allocations still occur; this fix reduces retained storage, not cumulative
|
||||
allocation. The nonempty benchmark remains near 1 MiB for four 256 KiB bodies.
|
||||
Artifact package race tests and vet passed, and the internal documentation
|
||||
now accurately describes the compaction condition.
|
||||
|
||||
Location: [file reader](../../internal/artifact/reader.go), lines 137–166.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user