kiszk commented on a change in pull request #23272: [SPARK-26265][Core] Fix 
deadlock in BytesToBytesMap.MapIterator when locking both 
BytesToBytesMap.MapIterator and TaskMemoryManager
URL: https://github.com/apache/spark/pull/23272#discussion_r240735509
 
 

 ##########
 File path: core/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java
 ##########
 @@ -283,6 +290,9 @@ private void advanceToNextPage() {
           }
         }
       }
+      if (pageToFree != null) {
+        freePage(pageToFree);
 
 Review comment:
   @viirya @cloud-fan Sorry for late comment. But, I have one question.
   
   Before this PR, `freePage(currentPage)` is always called if `if (destructive 
&& currentPage != null)` is satisfied.  
   After this PR, `freePage(pageToFree)` may not be called if `if 
(dataPages.size() > nextIdx) { ...}` throw an exception. In that case, I am 
curious whether `pageToFree` is collected somewhere or not.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to