Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3543#discussion_r21622115
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala ---
    @@ -262,7 +263,7 @@ class SQLContext(@transient val sparkContext: 
SparkContext)
       def createParquetFile[A <: Product : TypeTag](
           path: String,
           allowExisting: Boolean = true,
    -      conf: Configuration = new Configuration()): SchemaRDD = {
    --- End diff --
    
    @koeninger The issue that you linked is concerned with thread-safety issues 
when multiple threads concurrently modify the same `Configuration` instance.
    
    It turns out that there's another, older thread-safety issue related to 
`Configuration`'s constructor not being thread-safe due to non-thread-safe 
static state: https://issues.apache.org/jira/browse/HADOOP-10456.  This has 
been fixed in some newer Hadoop releases, but since it was only reported in 
April I don't think we can ignore it.  As a result, 
https://issues.apache.org/jira/browse/SPARK-1097 implements a workaround which 
synchronizes on an object before calling `new Configuration`.  Currently, I 
think the extra synchronization logic is only implemented in `HadoopRDD`, but 
it should probably be used everywhere just to be safe.  I think that 
`HadoopRDD` was the "highest-risk" place where we might have many threads 
creating Configurations at the same time, which is probably why that patch's 
author didn't add the synchronization everywhere.


---
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]

Reply via email to