zhijiangW commented on a change in pull request #8133: [FLINK-12146][network] 
Remove unregister task from NetworkEnvironment to simplify the interface of 
ShuffleService
URL: https://github.com/apache/flink/pull/8133#discussion_r275294640
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java
 ##########
 @@ -879,6 +875,42 @@ else if (transitionState(current, ExecutionState.FAILED, 
t)) {
                }
        }
 
+       /**
+        * There are two scenarios to release the network resources. One is 
from {@link TaskCanceler} to early
+        * release partitions and gates. Another is from task thread during 
task exiting.
+        */
+       private void closeNetworkResources(boolean isCanceling) {
 
 Review comment:
   I agree with the option of keeping previous static TaskCanceler class. 
   But the static `closeNetworkResources` might need two more parameters. One 
is for `taskNameWithSubtask` used for log, and another is the boolean 
`isCanceledOrFailed` because in previous behavior the result of  
`isCanceledOrFailed` is not always equal to `cause != null`. In the case of 
`Task#cancelExecution`, the cause is null but `isCanceledOrFailed` would return 
true. What do you think?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to