normanmaurer commented on code in PR #4597:
URL: https://github.com/apache/hbase/pull/4597#discussion_r915649863


##########
hbase-asyncfs/src/main/java/org/apache/hadoop/hbase/io/asyncfs/FanOutOneBlockAsyncDFSOutput.java:
##########
@@ -429,6 +429,9 @@ private void flushBuffer(CompletableFuture<Long> future, 
ByteBuf dataBuf,
       future.completeExceptionally(new IOException("stream already broken"));
       // it's the one we have just pushed or just a no-op
       waitingAckQueue.removeFirst();
+
+      // This method takes ownership of the dataBuf so we need release it 
before returning.
+      dataBuf.release();

Review Comment:
   You are right... that said I think just do the release explicit in the if 
block is cleaner. Also `safeRelease` is usually a code smell as it means you 
might call release too often. 



-- 
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]

Reply via email to