xuechendi commented on a change in pull request #32534:
URL: https://github.com/apache/spark/pull/32534#discussion_r635359537
##########
File path: core/src/main/scala/org/apache/spark/storage/memory/MemoryStore.scala
##########
@@ -387,6 +388,14 @@ private[spark] class MemoryStore(
def remove(blockId: BlockId): Boolean = memoryManager.synchronized {
val entry = entries.synchronized {
+ entries.get(blockId) match {
+ case e: DeserializedMemoryEntry[_] => e.value.foreach(v => v match {
+ case o: AutoCloseable =>
Review comment:
@mridulm , I see, to me, I think AutoCloseable is mostly commonly used,
and close function implemented should be safe to close even more than once if
it already be called by exception. Anyway, I can create a self-defined trait
maybe named as "ManualCloseable", then any class extends from this
"ManualCloseable" can be manual closed here, does that makes sense to you?
@srowen , what do you think?
--
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]