azagrebin commented on a change in pull request #7822: [FLINK-11726][network] 
Refactor the creation of ResultPartition and InputGate into NetworkEnvironment
URL: https://github.com/apache/flink/pull/7822#discussion_r267794310
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/NetworkEnvironment.java
 ##########
 @@ -292,40 +392,31 @@ public void unregisterTask(Task task) {
                LOG.debug("Unregister task {} from network environment (state: 
{}).",
                                task.getTaskInfo().getTaskNameWithSubtasks(), 
task.getExecutionState());
 
-               final ExecutionAttemptID executionId = task.getExecutionId();
-
                synchronized (lock) {
                        if (isShutdown) {
                                // no need to do anything when we are not 
operational
                                return;
                        }
 
                        if (task.isCanceledOrFailed()) {
-                               
resultPartitionManager.releasePartitionsProducedBy(executionId, 
task.getFailureCause());
+                               
resultPartitionManager.releasePartitionsProducedBy(task.getExecutionId(), 
task.getFailureCause());
                        }
 
-                       for (ResultPartition partition : 
task.getProducedPartitions()) {
+                       for (ResultPartition partition : 
allPartitions.get(task.getTaskInfo().getTaskId())) {
 
 Review comment:
   the method could also accept `cause` additionally to id. `cause != null` 
would mean failure case.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to