CompressStream double-closes the blobgen.Writer causing potential errors #28
Loading…
Reference in New Issue
Block a user
No description provided.
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?
Bug
In
internal/blobgen/compress.go,CompressStreamhas both adefer w.Close()and an explicitw.Close()call:The
Writer.Close()callscompressor.Close()thenencryptor.Close(). The second close on the zstd encoder returns an error ("use after close"), and the age encryptor close may write duplicate finalization bytes to the output, corrupting the stream.Fix
Use a
writerClosedflag pattern (already used insnapshot.gocompressFile) or remove the defer.