flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [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
Date Mon, 15 Apr 2019 09:42:40 GMT
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_r275282013
 
 

 ##########
 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 would break this method down:
   ```
   private void releaseNetworkResources() {
     for all partitions taskEventDispatcher.unregisterPartition
     Throwable cause = isCanceledOrFailed() ? getFailureCause() : null;
     closeOrFailNetworkResources(producedPartitions, inputGates, cause);
   }
   
   static closeNetworkResources(producedPartitions, inputGates, cause) {
     // closing loops or fail for partition if cause is null
   }
   
   TaskCanceler.run() {
     closeOrFailNetworkResources(producedPartitions, inputGates, null); // to preserve what
we have
   }
   ```
   I would also keep TaskCanceler class static to simplify refactoring in future.

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

Mime
View raw message