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 Fri, 12 Apr 2019 15:31:01 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_r273917521
 
 

 ##########
 File path: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartition.java
 ##########
 @@ -326,6 +326,23 @@ public void release(Throwable cause) {
 
 	@Override
 	public void close() {
+		close(null);
+	}
+
+	/**
+	 * There are two scenarios to close the result partition.
+	 *
+	 * <p>For FINISHED task, we only destroy buffer pool to free available segments.
+	 *
+	 * <p>For FAILED or CANCELING task, we should also release the result partition.
+	 *
+	 * @param throwable which indicates FAILED/CANCELING task if not null
+	 */
+	public void close(Throwable throwable) {
 
 Review comment:
   I am wondering if we should actually call this method `fail(cause)` and make it:
   ```
   public void close() {
   		if (bufferPool != null) {
   			bufferPool.lazyDestroy();
   		}
   }
   
   public void fail(@Nonnull Throwable throwable) {
   		partitionManager.releasePartitionsProducedBy(partitionId.getProducerId(), throwable);
   		close();
   }
   ```

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