reswqa commented on code in PR #21419:
URL: https://github.com/apache/flink/pull/21419#discussion_r1040779118
##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/HsMemoryDataManager.java:
##########
@@ -181,18 +188,33 @@ public HsDataView registerNewConsumer(
/** Close this {@link HsMemoryDataManager}, it means no data can append to
memory. */
public void close() {
- Decision decision = callWithLock(() ->
spillStrategy.onResultPartitionClosed(this));
- handleDecision(Optional.of(decision));
- spiller.close();
- poolSizeChecker.shutdown();
+ synchronized (releaseAndCloseLock) {
+ if (!isAllDataReleased) {
+ spillAndReleaseAllData();
+ }
+ spiller.close();
+ poolSizeChecker.shutdown();
+ }
}
/**
* Release this {@link HsMemoryDataManager}, it means all memory taken by
this class will
* recycle.
*/
public void release() {
- spiller.release();
+ synchronized (releaseAndCloseLock) {
+ if (!isAllDataReleased) {
+ spillAndReleaseAllData();
+ }
+ spiller.release();
+ }
+ }
Review Comment:
Agree with you, we should release all network buffers in close method.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]