cloud-fan commented on issue #24467: [SPARK-27568][CORE] Fix readLock leak 
while calling take()/first() on a cached rdd
URL: https://github.com/apache/spark/pull/24467#issuecomment-489882706
 
 
   This reminds me of the memory leak issue in sort-merge-join.
   
   We use scala `Iterator` to exchange data between SQL operators/RDDs, and we 
can only do the cleanup work when the `Iterator` is consumed up, or in a task 
completion listener.
   
   But what we really need is a traditional database iterator, with `open`, 
`next`, `get` and `close` methods. When a downstream operator finishes its work 
without consuming up the input data, it can call `close` to do free the 
resource.
   
   For this particular case, I think using a task completion listener is good 
enough?

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


With regards,
Apache Git Services

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

Reply via email to