Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into SPARK-2177
Browse files Browse the repository at this point in the history
  • Loading branch information
yhuai committed Jun 18, 2014
2 parents 342fdf7 + dd96fcd commit 74bd1d4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions core/src/main/scala/org/apache/spark/storage/BlockManager.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 74bd1d4

Please sign in to comment.