diff options
author | Sean Owen <sowen@cloudera.com> | 2017-03-18 18:01:24 +0100 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2017-03-18 18:01:24 +0100 |
commit | 54e61df2634163382c7d01a2ad40ffb5e7270abc (patch) | |
tree | 6cf3604d76e07d1155e98f80a317fbef3c4aa30e | |
parent | ccba622e35741d8344ec8d74b6750529b2c7219b (diff) | |
download | spark-54e61df2634163382c7d01a2ad40ffb5e7270abc.tar.gz spark-54e61df2634163382c7d01a2ad40ffb5e7270abc.tar.bz2 spark-54e61df2634163382c7d01a2ad40ffb5e7270abc.zip |
[SPARK-16599][CORE] java.util.NoSuchElementException: None.get at at 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 <sowen@cloudera.com>
Closes #17290 from srowen/SPARK-16599.
-rw-r--r-- | core/src/main/scala/org/apache/spark/storage/BlockInfoManager.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/main/scala/org/apache/spark/storage/BlockInfoManager.scala b/core/src/main/scala/org/apache/spark/storage/BlockInfoManager.scala index dd8f5bacb9..490d45d12b 100644 --- a/core/src/main/scala/org/apache/spark/storage/BlockInfoManager.scala +++ b/core/src/main/scala/org/apache/spark/storage/BlockInfoManager.scala @@ -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 @@ -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) |