xuechendi commented on a change in pull request #32534:
URL: https://github.com/apache/spark/pull/32534#discussion_r634093759
##########
File path: core/src/main/scala/org/apache/spark/storage/memory/MemoryStore.scala
##########
@@ -405,6 +427,23 @@ private[spark] class MemoryStore(
def clear(): Unit = memoryManager.synchronized {
entries.synchronized {
+ val entryManualCloseTasks = ArrayBuffer.empty[Future[Unit]]
+ entries.values.asScala.foreach {
+ case e: DeserializedMemoryEntry[_] => e.value.foreach {
+ case o: AutoCloseable =>
+ entryManualCloseTasks += Future {
Review comment:
@srowen , yes, your concern totally makes sense, now I changed to only
use one Future to cleanup all, so cleanup won't start too much threads, and I
added a 10ms wait in each close [UnitTest
Link](https://github.com/apache/spark/pull/32534/files#diff-c4f6f7a030459e4a28c597761512bf4f02d4a213818da66525e0ba9c0327c47aR628-R637)
to pretend as an expensive close.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]