curcur commented on a change in pull request #16844:
URL: https://github.com/apache/flink/pull/16844#discussion_r690885852



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java
##########
@@ -1182,7 +1186,10 @@ void 
cancelOrFailAndCancelInvokableInternal(ExecutionState targetState, Throwabl
                         Runnable canceler =
                                 new TaskCanceler(
                                         LOG,
-                                        this::closeNetworkResources,
+                                        () -> {
+                                            failAllResultPartitions();
+                                            closeAllInputGates();
+                                        },

Review comment:
       exaplain why changing resource release -> fail + release reources.

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartition.java
##########
@@ -250,15 +250,20 @@ public void release(Throwable cause) {
     /** Releases all produced data including both those stored in memory and 
persisted on disk. */
     protected abstract void releaseInternal();
 
-    @Override
-    public void close() {
+    private void closeBufferPool() {
         if (bufferPool != null) {
             bufferPool.lazyDestroy();
         }
     }
 
+    @Override
+    public void close() {
+        closeBufferPool();
+    }
+
     @Override
     public void fail(@Nullable Throwable throwable) {
+        closeBufferPool();

Review comment:
       add a comment why adding closebuffer in fail




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