Skip to content

Close() on zstd encoder doesn't call close on underlying writer. #1100

@cloudshiftchris

Description

@cloudshiftchris

When calling .Close() on a zstd Encoder (via zstd.NewWriter, wrapping an existing writer), it does not call .Close() on the wrapped writer. This requires tracking the underlying writer to ensure it gets closed properly.

Especially problematic when using with io.Pipe (or other streaming situations), as the underlying PipeWriter must be closed to signal to the reader that everything is completed.

The documentation for zstd.NewWriter is silent on this; it provides no indication of who is responsible for lifecycle management of the passed-in Writer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions