Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ZstdOutputStream corruption on double close #182

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

mszabo-wikia
Copy link
Contributor

ZstdOutputStream will write out the last chunk every time close() is invoked on it, which can cause errors when the output is later decompressed. Per the java.io.Closeable interface documentation, the close() method should have no effect if invoked on an already-closed stream (which is how e.g. the core DeflaterOutputStream behaves as well), so make it a noop if the stream was already closed.

ZstdOutputStream will write out the last chunk every time close() is
invoked on it, which can cause errors when the output is later
decompressed. Per the java.io.Closeable interface documentation, the close() method
should have no effect if invoked on an already-closed stream (which is
how e.g. the core DeflaterOutputStream behaves as well), so make it a
noop if the stream was already closed.
@dain dain merged commit ca561c8 into airlift:master Jan 17, 2024
3 checks passed
@dain
Copy link
Member

dain commented Jan 17, 2024

Thanks!

@mszabo-wikia mszabo-wikia deleted the zstd-double-close branch January 17, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants