hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Varun Saxena (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HADOOP-11209) Configuration is not thread-safe
Date Wed, 21 Jan 2015 19:27:35 GMT

     [ https://issues.apache.org/jira/browse/HADOOP-11209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Varun Saxena updated HADOOP-11209:
----------------------------------
    Attachment: HADOOP-11209.004.patch

> Configuration is not thread-safe
> --------------------------------
>
>                 Key: HADOOP-11209
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11209
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: conf
>            Reporter: Josh Rosen
>            Assignee: Varun Saxena
>         Attachments: HADOOP-11209.001.patch, HADOOP-11209.002.patch, HADOOP-11209.003.patch,
HADOOP-11209.004.patch
>
>
> {{Configuration}} objects are not fully thread-safe, which causes problems in multi-threaded
frameworks like Spark that use these configurations to interact with existing Hadoop APIs
(such as InputFormats).
> SPARK-2546 is an example of a problem caused by this lack of thread-safety.  In that
bug, multiple concurrent modifications of the same Configuration (in third-party code) caused
an infinite loop because Configuration's internal {{java.util.HashMap}} is not thread-safe.
> One workaround is for our code to clone Configuration objects; unfortunately, this also
suffers from thread-safety issues on older Hadoop versions because Configuration's constructor
wasn't thread-safe (HADOOP-10456).
> [Looking at a recent version of Configuration.java|https://github.com/apache/hadoop/blob/d989ac04449dc33da5e2c32a7f24d59cc92de536/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java#L666],
it seems that the private {{updatingResource}} HashMap and {{finalParameters}} HashSet fields
the only non-thread-safe collections in Configuration (Java's {{Properties}} class is thread-safe),
so I don't think that it would be hard to make Configuration fully thread-safe.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message