curcur commented on pull request #16844:
URL: https://github.com/apache/flink/pull/16844#issuecomment-900799942


   One last question:
   
   What if we move the change to `releaseInternal`, like this. In this way, we 
do not need for refacotring or changing fail(). WDYT?
   
   ```
      @Override
       protected void releaseInternal() {
           // Release all subpartitions
           for (ResultSubpartition subpartition : subpartitions) {
               try {
                   subpartition.release();
               }
               // Catch this in order to ensure that release is called on all 
subpartitions
               catch (Throwable t) {
                   LOG.error("Error during release of result subpartition: " + 
t.getMessage(), t);
               }
           }
   
          if (broadcastBufferBuilder != null) {
               broadcastBufferBuilder.close();
               broadcastBufferBuilder = null;
           }
           for (int i = 0; i < unicastBufferBuilders.length; ++i) {
               if (unicastBufferBuilders[i] != null) {
                   unicastBufferBuilders[i].close();
                   unicastBufferBuilders[i] = null;
               }
           }    
       }
   ```


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