You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/04/12 15:31:01 UTC

[GitHub] [flink] azagrebin commented on a change in pull request #8133: [FLINK-12146][network] Remove unregister task from NetworkEnvironment to simplify the interface of ShuffleService

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

 ##########
 File path: flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java
 ##########
 @@ -879,6 +875,24 @@ else if (transitionState(current, ExecutionState.FAILED, t)) {
 		}
 	}
 
+	private void releaseNetworkResources() throws Exception {
+		LOG.debug("Release task {} network resources (state: {}).",
+			taskInfo.getTaskNameWithSubtasks(), getExecutionState());
+
+		for (ResultPartition partition : producedPartitions) {
+			taskEventDispatcher.unregisterPartition(partition.getPartitionId());
+			partition.close();
 
 Review comment:
   but I think it would be ok, if we actually add one more method `closeNetworkResources` and put there partition/gate closings from `TaskCanceler.run` and use here in `releaseNetworkResources` after `taskEventDispatcher.unregisterPartition` and `if () partition.fail` loops. We will eliminate code duplication and improve log/exception handling in former `unregisterTask`.

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


With regards,
Apache Git Services