-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HDFS-17317. Improve the resource release for metaOut in DebugAdmin #6402
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
Conversation
ayushtkn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
I have triggered a new build: we need to get a green build before we can merge |
OK,Thanks |
|
💔 -1 overall
This message was automatically generated. |
We have related failures: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6402/2/testReport/
|
@ayushtkn Here need flush first,had change it and need trigger a new CI build again? |
| smallBufferSize)); | ||
| BlockMetadataHeader.writeHeader(metaOut, checksum); | ||
| metaOut.close(); | ||
| metaOut.flush(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think close itself is ok, we can avoid closing in the finally block if the stream is already closing, rather than flushing here & then closing below, close would be calling flush before closing itself.
in general I don't think it isn't a big problem, maybe just dereference the metaOut after close
metaOut.close();
metaOut = null;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea,I had change it @ayushtkn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you got me wrong, only 1 line was required, finally should have remained, if there is an exception before close, the stream would remain open otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes,I misstaked,keep finally block and add 1 line. @ayushtkn
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
@ayushtkn https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6402/7/ UT seems all success,but the result is not all passed |
ayushtkn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@ayushtkn could you help to merge? |
|
there is some release branching going out, let me recircle once that is done & I will merge this |
OK,other release branch testing seems not in github CI process |
|
💔 -1 overall
This message was automatically generated. |
…pache#6402). Contributed by xy. Reviewed-by: Shilun Fan <slfan1989@apache.org> Signed-off-by: Ayush Saxena <ayushsaxena@apache.org
Description of PR
DebugAdmin metaOut not need multiple close
How was this patch tested?
not need
For code changes:
LICENSE,LICENSE-binary,NOTICE-binaryfiles?