Skip to content

Commit

Permalink
[SPARK-16599][CORE] java.util.NoSuchElementException: None.get at at …
Browse files Browse the repository at this point in the history
…org.apache.spark.storage.BlockInfoManager.releaseAllLocksForTask

## What changes were proposed in this pull request?

Avoid None.get exception in (rare?) case that no readLocks exist
Note that while this would resolve the immediate cause of the exception, it's not clear it is the root problem.

## How was this patch tested?

Existing tests

Author: Sean Owen <[email protected]>

Closes apache#17290 from srowen/SPARK-16599.
  • Loading branch information
srowen committed Mar 18, 2017
1 parent ccba622 commit 54e61df
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import scala.collection.JavaConverters._
import scala.collection.mutable
import scala.reflect.ClassTag

import com.google.common.collect.ConcurrentHashMultiset
import com.google.common.collect.{ConcurrentHashMultiset, ImmutableMultiset}

import org.apache.spark.{SparkException, TaskContext}
import org.apache.spark.internal.Logging
Expand Down Expand Up @@ -340,7 +340,7 @@ private[storage] class BlockInfoManager extends Logging {
val blocksWithReleasedLocks = mutable.ArrayBuffer[BlockId]()

val readLocks = synchronized {
readLocksByTask.remove(taskAttemptId).get
readLocksByTask.remove(taskAttemptId).getOrElse(ImmutableMultiset.of[BlockId]())
}
val writeLocks = synchronized {
writeLocksByTask.remove(taskAttemptId).getOrElse(Seq.empty)
Expand Down

0 comments on commit 54e61df

Please sign in to comment.