xintongsong commented on a change in pull request #15246:
URL: https://github.com/apache/flink/pull/15246#discussion_r595662005



##########
File path: 
flink-core/src/main/java/org/apache/flink/core/memory/HybridMemorySegment.java
##########
@@ -131,6 +131,9 @@
 
     @Override
     public void free() {
+        if (isFreed()) {
+            throw new IllegalStateException("HybridMemorySegment can be freed 
only once!");
+        }

Review comment:
       I'd suggest to scope this change out from this PR.
   
   I'm afraid currently there are other causes that can lead to a segment being 
freed multiple times. That's also what the CI failures suggest.
   
   As discussed 
[here](https://issues.apache.org/jira/browse/FLINK-21419?focusedCommentId=17301350&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17301350),
 we are planning to enable this check-and-fail only for CI and gradually hunt 
down all the misuse case.




----------------------------------------------------------------
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:
[email protected]


Reply via email to