squito commented on a change in pull request #25951: [SPARK-28917][CORE]
Synchronize access to RDD mutable state.
URL: https://github.com/apache/spark/pull/25951#discussion_r329780941
##########
File path: core/src/main/scala/org/apache/spark/rdd/RDD.scala
##########
@@ -223,12 +236,12 @@ abstract class RDD[T: ClassTag](
}
/** Get the RDD's current storage level, or StorageLevel.NONE if none is
set. */
- def getStorageLevel: StorageLevel = storageLevel
+ def getStorageLevel: StorageLevel = stateLock.synchronized { storageLevel }
// Our dependencies and partitions will be gotten by calling subclass's
methods below, and will
// be overwritten when we're checkpointed
- private var dependencies_ : Seq[Dependency[_]] = _
- @transient private var partitions_ : Array[Partition] = _
+ @volatile private var dependencies_ : Seq[Dependency[_]] = _
Review comment:
checkpointing resets these to null, so they can't be lazy vals
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]