Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/3121#discussion_r20393642
--- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
@@ -1417,6 +1427,97 @@ class SparkContext(config: SparkConf) extends
SparkStatusAPI with Logging {
*/
object SparkContext extends Logging {
+ /**
+ * Lock that guards access to global variables that track SparkContext
construction.
+ */
+ private[spark] val SPARK_CONTEXT_CONSTRUCTOR_LOCK = new Object()
+
+ /**
+ * Records the creation site of the active, fully-constructed
SparkContext. If no SparkContext
+ * is active, then this is `None`.
+ *
+ * Access to this field is guarded by SPARK_CONTEXT_CONSTRUCTOR_LOCK
+ */
+ private[spark] var activeContextCreationSite: Option[CallSite] = None
+
+ /**
+ * Points to a partially-constructed SparkContext if some thread is in
the SparkContext
+ * constructor, or `None` if no SparkContext is being constructed.
+ *
+ * Access to this field is guarded by SPARK_CONTEXT_CONSTRUCTOR_LOCK
+ */
+ private[spark] var contextBeingConstructed: Option[SparkContext] = None
--- End diff --
I think these can all be strictly `private`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]