zhijiangW commented on a change in pull request #8566: [FLINK-12673][network] Introduce NetworkEnvironment.getUnreleasedPartitions instead of using getResultPartitionManager URL: https://github.com/apache/flink/pull/8566#discussion_r288840346
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/NetworkEnvironment.java ########## @@ -201,6 +203,18 @@ public void releasePartitions(Collection<ResultPartitionID> partitionIds) { } } + /** + * Query unreleased partitions. + * + * @return collection of partitions which still occupy some resources locally on this task executor + * and have not been released yet. The partition can be released either with {@link ResultPartitionWriter#fail(Throwable)} + * or {@link ResultPartitionWriter#finish()} and then with {@link ResultPartitionWriter#close()} after fail or finish. Review comment: It might bring some confusing here. `ResultPartitionWriter` has two different states `FINISHED` and `RELEASED` separately. `ResultPartitionWriter#finish()` only indicates the whole data produced and enters `FINISHED` state, but the partition is not released yet. The release could only happen in three scenarios atm - `ResultPartitionWriter#fail` when task is failed or canceled - `NetworkEnvironment#releasePartitions` from JM RPC call - `ResultPartitionManager#onConsumedPartition` when partition is consumed by consumer side In addition, it might be better to put these comments above and make `@return` short. ---------------------------------------------------------------- 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