aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/src/main/scala/org/apache/spark/storage/BlockManager.scala10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/src/main/scala/org/apache/spark/storage/BlockManager.scala b/core/src/main/scala/org/apache/spark/storage/BlockManager.scala
index 373987c122..d2f7baf928 100644
--- a/core/src/main/scala/org/apache/spark/storage/BlockManager.scala
+++ b/core/src/main/scala/org/apache/spark/storage/BlockManager.scala
@@ -363,11 +363,13 @@ private[spark] class BlockManager(
val info = blockInfo.get(blockId).orNull
if (info != null) {
info.synchronized {
- // Double check to make sure the block is still there, since removeBlock
- // method also synchronizes on BlockInfo object, so the block might have
- // been removed when we actually come here.
+ // Double check to make sure the block is still there. There is a small chance that the
+ // block has been removed by removeBlock (which also synchronizes on the blockInfo object).
+ // Note that this only checks metadata tracking. If user intentionally deleted the block
+ // on disk or from off heap storage without using removeBlock, this conditional check will
+ // still pass but eventually we will get an exception because we can't find the block.
if (blockInfo.get(blockId).isEmpty) {
- logDebug(s"Block $blockId had been removed")
+ logWarning(s"Block $blockId had been removed")
return None
}