You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/10/03 18:13:30 UTC

[GitHub] [spark] srowen commented on a change in pull request #25951: [SPARK-28917][CORE] Synchronize access to RDD mutable state.

srowen 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_r331180810
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rdd/RDD.scala
 ##########
 @@ -103,6 +103,17 @@ abstract class RDD[T: ClassTag](
     _sc
   }
 
+  /**
+   * Lock for all mutable state of this RDD (persistence, partitions, dependencies, etc.).  We do
+   * not use `this` because RDDs are user-visible, so users might have added their own locking on
+   * RDDs; sharing that could lead to a deadlock.
+   *
+   * One thread might hold the lock on many of these, for a chain of RDD dependencies; but
+   * because DAGs are acyclic, and we only ever hold locks for one path in that DAG, there is no
+   * chance of deadlock.
+   */
+  private val stateLock = new SerializableObject()
 
 Review comment:
   Nah, neutral on it. Up to you.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org