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



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/memory/MemoryManager.java
##########
@@ -346,9 +346,6 @@ private MemorySegment releaseSegmentsForOwnerUntilNextOwner(
                     while (segmentsIterator.hasNext()) {
                         MemorySegment segment = segmentsIterator.next();
                         try {
-                            if (segment == null || segment.isFreed()) {

Review comment:
       @kezhuw,
   Thanks for the explanation. Now I see how could the `segment` be `null`.
   
   I think it makes sense for `release(Collection<MemorySegment>)` being able 
to handle potential `null` values in the argument collection, either ignore it 
or fail. But I have to say its super implicit that the iterator passed into 
`releaseSegmentsForOwnerUntilNextOwner()` still contains null values.
   
   Anyway, I agree that it indeed deserves a dedicated ticket to gracefully 
handle the null values. I'll revert the removal of null check.




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