Close Input Streams in HDFS and Local Exchange storage#18606
Merged
losipiuk merged 1 commit intotrinodb:masterfrom Aug 17, 2023
Merged
Close Input Streams in HDFS and Local Exchange storage#18606losipiuk merged 1 commit intotrinodb:masterfrom
losipiuk merged 1 commit intotrinodb:masterfrom
Conversation
linzebing
reviewed
Aug 9, 2023
Member
There was a problem hiding this comment.
I might be missing something obvious. sliceInput is closed here, right?
Member
Author
There was a problem hiding this comment.
Every time getSliceInput is called, a new InputStreamSliceInput is created.. so we are not closing every input stream.
Member
There was a problem hiding this comment.
Oh, then should we delete the code of:
if (sliceInput != null) {
sliceInput.close();
sliceInput = null;
}
? It becomes redundant now, right?
linzebing
approved these changes
Aug 10, 2023
bdbfb00 to
fbb8faf
Compare
linzebing
approved these changes
Aug 10, 2023
021d586 to
11079f8
Compare
Member
Author
|
The failing tests look unrelated. |
losipiuk
reviewed
Aug 16, 2023
Member
There was a problem hiding this comment.
It looks like we do not need to accumulate all the sliceInputs in closer.
Instead we can do change
if (sliceInput != null && sliceInput.isReadable()) {
return sliceInput.readSlice(sliceInput.readInt());
}
to
if (sliceInput != null) {
if (sliceInput.isReadable()) {
return sliceInput.readSlice(sliceInput.readInt());
}
else {
sliceInput.close();
}
}
… Exchange storage
11079f8 to
c3bf64e
Compare
losipiuk
approved these changes
Aug 17, 2023
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.
Description
When reading slices in HDFS and Local exchange storage, all input streams are not getting closed leading to connection leaks.
Additional context and related issues
Release notes
(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: