perf: stream proxied artifacts instead of buffering the full body in memory #66
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
internal/proxy/engine.go:187reads every upstream response withio.ReadAll, hashes it in memory, uploads from memory and serves from memory. Large immutable blobs (Docker layers, RPMs, tarballs, Go module zips) — or several concurrent ones — can OOM the process.A streaming tempfile-backed CAS already exists (
internal/storage/cas.go) and is used by local uploads, but the proxy path bypasses it;Engine.casis even assigned inNewEngineand never used.Fix: stream immutable fetches through the CAS (tee to sha256 + S3), only buffer mutable index files (small, need RewriteResponse).