ZanderXu commented on code in PR #8498:
URL: https://github.com/apache/hadoop/pull/8498#discussion_r3256021613
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/erasurecode/StripedBlockWriter.java:
##########
@@ -151,6 +151,7 @@ private void init() throws IOException {
success = true;
} finally {
if (!success) {
+ stripedWriter.getReconstructor().freeBuffer(targetBuffer);
Review Comment:
Nice catch.
```
stripedWriter.getReconstructor().freeBuffer(targetBuffer);
targetBuffer = null;
```
So how about change the method `freeTargetBuffer()` to
```
void freeTargetBuffer() {
if (targetBuffer != null) {
stripedWriter.getReconstructor().freeBuffer(targetBuffer);
targetBuffer = null;
}
}
```
And change the caller of the `freeTargetBuffer()`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]