SPARK-16420: Ensure compression streams are closed.#14093
Closed
rdblue wants to merge 3 commits intoapache:masterfrom
Closed
SPARK-16420: Ensure compression streams are closed.#14093rdblue wants to merge 3 commits intoapache:masterfrom
rdblue wants to merge 3 commits intoapache:masterfrom
Conversation
| ByteStreams.copy(partitionInputStream, mergedFileOutputStream); | ||
| innerThrewException = false; | ||
| } finally { | ||
| Closeables.close(partitionInputStream, innerThrewException); |
Member
There was a problem hiding this comment.
Not that it matters much, but what about also using the Utils.tryWithSafeFinally pattern here for some consistency?
Contributor
Author
There was a problem hiding this comment.
This is the usual equivalent for Java code.
Member
There was a problem hiding this comment.
Oh duh it's Java. I have made that mistake about 10 times now
|
Test build #61916 has finished for PR 14093 at commit
|
This adds an option to LimitedInputStream to not close the underlying stream when it is reused, which is the case in UnsafeShuffleWriter.
|
Test build #61926 has finished for PR 14093 at commit
|
| left -= skipped; | ||
| return skipped; | ||
| } | ||
| @Override |
Contributor
|
cc @JoshRosen |
Contributor
|
LGTM pending Jenkins. |
|
Test build #61988 has finished for PR 14093 at commit
|
Contributor
|
Merging in master/2.0. |
asfgit
pushed a commit
that referenced
this pull request
Jul 8, 2016
## What changes were proposed in this pull request? This uses the try/finally pattern to ensure streams are closed after use. `UnsafeShuffleWriter` wasn't closing compression streams, causing them to leak resources until garbage collected. This was causing a problem with codecs that use off-heap memory. ## How was this patch tested? Current tests are sufficient. This should not change behavior. Author: Ryan Blue <blue@apache.org> Closes #14093 from rdblue/SPARK-16420-unsafe-shuffle-writer-leak. (cherry picked from commit 67e085e) Signed-off-by: Reynold Xin <rxin@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This uses the try/finally pattern to ensure streams are closed after use.
UnsafeShuffleWriterwasn't closing compression streams, causing them to leak resources until garbage collected. This was causing a problem with codecs that use off-heap memory.How was this patch tested?
Current tests are sufficient. This should not change behavior.