Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 589B217B40 for ; Sun, 25 Jan 2015 12:18:35 +0000 (UTC) Received: (qmail 22023 invoked by uid 500); 25 Jan 2015 12:18:35 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 21977 invoked by uid 500); 25 Jan 2015 12:18:35 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 21966 invoked by uid 99); 25 Jan 2015 12:18:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Jan 2015 12:18:35 +0000 Date: Sun, 25 Jan 2015 12:18:35 +0000 (UTC) From: "Varun Saxena (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-11209) Configuration#updatingResource/finalParameters are not thread-safe MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-11209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14291074#comment-14291074 ] Varun Saxena commented on HADOOP-11209: --------------------------------------- Thanks [~ozawa] for the review and commit > Configuration#updatingResource/finalParameters are not thread-safe > ------------------------------------------------------------------ > > Key: HADOOP-11209 > URL: https://issues.apache.org/jira/browse/HADOOP-11209 > Project: Hadoop Common > Issue Type: Bug > Components: conf > Affects Versions: 2.6.0 > Reporter: Josh Rosen > Assignee: Varun Saxena > Fix For: 2.7.0 > > 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)