Return-Path: X-Original-To: apmail-hadoop-yarn-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-yarn-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 1211217D29 for ; Tue, 14 Apr 2015 07:26:13 +0000 (UTC) Received: (qmail 66398 invoked by uid 500); 14 Apr 2015 07:26:12 -0000 Delivered-To: apmail-hadoop-yarn-issues-archive@hadoop.apache.org Received: (qmail 66341 invoked by uid 500); 14 Apr 2015 07:26:12 -0000 Mailing-List: contact yarn-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: yarn-issues@hadoop.apache.org Delivered-To: mailing list yarn-issues@hadoop.apache.org Received: (qmail 66329 invoked by uid 99); 14 Apr 2015 07:26:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Apr 2015 07:26:12 +0000 Date: Tue, 14 Apr 2015 07:26:12 +0000 (UTC) From: "Jun Gong (JIRA)" To: yarn-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (YARN-3389) Avoid race conditions when attempts operate on shared states concurrently 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/YARN-3389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14493716#comment-14493716 ] Jun Gong commented on YARN-3389: -------------------------------- [~jianhe] Thank you for the explanation. I thought RM's event dispatcher is multithread. Closing it now. > Avoid race conditions when attempts operate on shared states concurrently > ------------------------------------------------------------------------- > > Key: YARN-3389 > URL: https://issues.apache.org/jira/browse/YARN-3389 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager > Affects Versions: 2.6.0 > Reporter: Jun Gong > Assignee: Jun Gong > Attachments: YARN-3389.01.patch > > > In AttemptFailedTransition, new attempt will get states('justFinishedContainers' and 'finishedContainersSentToAM') reference from failed attempt. Then these attempts share the two states(previous attempts also share the two states). Suppose two or more CONTAINER_FINISHED events for different attempts are handled at the same time, and suppose they ran on same node. Attempts will update justFinishedContainers's same key's value concurrently. Although 'justFinishedContainers' is a ConcurrentHashMap, operations on its value 'List' is not atomic, namely {code}appAttempt.justFinishedContainers.get(containerFinishedEvent.getNodeId()).add(containerFinishedEvent.getContainerStatus()){code} is not atomic. -- This message was sent by Atlassian JIRA (v6.3.4#6332)