Github user suyanNone commented on a diff in the pull request:
https://github.com/apache/spark/pull/3574#discussion_r21359660
--- Diff: core/src/main/scala/org/apache/spark/storage/BlockManager.scala
---
@@ -1089,15 +1089,17 @@ private[spark] class BlockManager(
val info = blockInfo.get(blockId).orNull
if (info != null) {
info.synchronized {
- // Removals are idempotent in disk store and memory store. At
worst, we get a warning.
- val removedFromMemory = memoryStore.remove(blockId)
- val removedFromDisk = diskStore.remove(blockId)
- val removedFromTachyon = if (tachyonInitialized)
tachyonStore.remove(blockId) else false
- if (!removedFromMemory && !removedFromDisk && !removedFromTachyon)
{
- logWarning(s"Block $blockId could not be removed as it was not
found in either " +
- "the disk, memory, or tachyon store")
+ if (blockInfo.get(blockId).isEmpty) {
--- End diff --
1. ThreadA into RemoveBlock(), and got info for blockId1
2. ThreadB into DropFromMemory(), and got info for blockId1
now Thread A, B all want got info.sychronized
B got, and drop block(blockId) from memory, and this block is use memory
only, so it remove from blockinfo. and then release the lock.
then A got, but info is already not in blockinfo.
Did I have miss sth or misunderstand sth? may dropForMemory and removeBlock
can't happen at the same time?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]