File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
core/src/main/scala/org/apache/spark Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -349,17 +349,14 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
349349 // Thread Local variable that can be used by users to pass information down the stack
350350 private val localProperties = new InheritableThreadLocal [Properties ] {
351351 override protected def childValue (parent : Properties ): Properties = {
352- if (nonInheritedLocalProperties.nonEmpty) {
353- // If there are properties that should not be inherited, filter them out
354- val p = new Properties
355- val filtered = parent.asScala.filter { case (k, _) =>
356- ! nonInheritedLocalProperties.contains(k)
357- }
358- p.putAll(filtered.asJava)
359- p
360- } else {
361- new Properties (parent)
352+ // Note: make a clone such that changes in the parent properties aren't reflected in
353+ // the those of the children threads, which has confusing semantics (SPARK-10564).
354+ val p = new Properties
355+ val filtered = parent.asScala.filter { case (k, _) =>
356+ ! nonInheritedLocalProperties.contains(k)
362357 }
358+ p.putAll(filtered.asJava)
359+ p
363360 }
364361 override protected def initialValue (): Properties = new Properties ()
365362 }
You can’t perform that action at this time.
0 commit comments