Skip to content

Commit 71765eb

Browse files
make logic correctly when unrolling memory if encounter exceptions
1 parent 6604e9a commit 71765eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/main/scala/org/apache/spark/storage/MemoryStore.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ private[spark] class MemoryStore(blockManager: BlockManager, maxMemory: Long)
290290
if (currentSize > memoryThreshold) {
291291
val amountToRequest = (currentSize * memoryGrowthFactor - memoryThreshold).toLong
292292
if (freeMemoryForUnroll < amountToRequest) {
293+
keepUnrolling = false
293294
var selectedMemory = 0L
294295
val selectedBlocks = new ArrayBuffer[BlockId]()
295296
val ensureSpaceResult = ensureFreeSpace(
@@ -318,8 +319,7 @@ private[spark] class MemoryStore(blockManager: BlockManager, maxMemory: Long)
318319
// update reservedUnrollMemoryMap, indicate the tobeDroppedBlocks that marked by
319320
// current thread has been dropped
320321
decreaseReservedUnrollMemoryForThisThread(amountToRequest)
321-
} else {
322-
keepUnrolling = false
322+
keepUnrolling = true
323323
}
324324
} else {
325325
increaseUnrollMemoryForThisThread(amountToRequest)

0 commit comments

Comments
 (0)