curcur edited a comment on pull request #16844:
URL: https://github.com/apache/flink/pull/16844#issuecomment-900431151


   Thanks @wsry for fixing up!  But I have a small concern about this change.
   
   1. It is necessary to recycle BufferBuilder in the 
BufferWritingResultPartition#close method, but not sure why we add 
`closeBufferPool()` in the `fail` method.
   
   2. Originally, `fail()` is responsible for propagating failure and release 
`**buffers**`, but not the `**buffer pool**`. `closeNetworkResources` is 
responsible to close network-related resources after `fail()` is called.
   In the `TaskCanceler`, `closeNetworkResources` is called to recycle 
resources and finally, BufferWritingResultPartition#close() will also be called 
as well as `closeBufferPool()` in `super.close()`.
   
   I am confused why we break this contract and include resource clean-up in 
fail(), and have to include fail in a cancler? 
   
   Put in another way, why simply add point 1 (the close method added in 
BufferWritingResultPartition) is not enough?
   
   Also, how about the `release` method instead of `close` method
   
   
   Let's discuss and sync up offline tomorrow.


-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to