ChenSammi commented on code in PR #6690:
URL: https://github.com/apache/ozone/pull/6690#discussion_r1611135403


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/common/ChunkBufferImplWithByteBuffer.java:
##########
@@ -163,4 +175,12 @@ public String toString() {
     return getClass().getSimpleName() + ":limit=" + buffer.limit()
         + "@" + Integer.toHexString(hashCode());
   }
+
+  @Override
+  protected void finalize() throws Throwable {

Review Comment:
   A ChunkBuffer is converted as one ByteString(data can be copied, or zero 
copied, depending on unsafe conversion is enabled or not). Multiple ByteString 
data for a readChunk request could be concatenated as one whole ByteString or a 
list of ByteString, depending on request options.  The whole response with data 
is passed to the GPRC call which is async. I could be wrong, but I didn't find 
any GRPC notification or callback to tell a response has been sent out 
successfully so that the buffer associated with the response can be safely 
released, when last time I investigated if it's feasible to adopt the buffer 
pool in datanode for data read.  
   
   When the response is finally sent out, the buffer will be auto released by 
GC some time later. GC will no call ChunkBuffer#close(), but it will call 
finalize().  



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

Reply via email to