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 5FC191770B for ; Tue, 28 Oct 2014 06:07:35 +0000 (UTC) Received: (qmail 50161 invoked by uid 500); 28 Oct 2014 06:07:35 -0000 Delivered-To: apmail-hadoop-yarn-issues-archive@hadoop.apache.org Received: (qmail 50119 invoked by uid 500); 28 Oct 2014 06:07:35 -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 50103 invoked by uid 99); 28 Oct 2014 06:07:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Oct 2014 06:07:35 +0000 Date: Tue, 28 Oct 2014 06:07:35 +0000 (UTC) From: "zhihai xu (JIRA)" To: yarn-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (YARN-2753) Shouldn't change the value in labelCollections if the key already exists and potential NPE at CommonNodeLabelsManager. 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-2753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] zhihai xu updated YARN-2753: ---------------------------- Description: CommonNodeLabelsManager#addToCluserNodeLabels should not change the value in labelCollections if the key already exists otherwise the Label.resource will be changed(reset). potential NPE(NullPointerException) in checkRemoveLabelsFromNode of CommonNodeLabelsManager. It because when a Node is created, Node.labels can be null. In this case, nm.labels; may be null. So we need check originalLabels not null before use it(originalLabels.containsAll). was: potential NPE(NullPointerException) in checkRemoveLabelsFromNode of CommonNodeLabelsManager. It because when a Node is created, Node.labels can be null. In this case, nm.labels; may be null. So we need check originalLabels not null before use it(originalLabels.containsAll). Summary: Shouldn't change the value in labelCollections if the key already exists and potential NPE at CommonNodeLabelsManager. (was: potential NPE in checkRemoveLabelsFromNode of CommonNodeLabelsManager) > Shouldn't change the value in labelCollections if the key already exists and potential NPE at CommonNodeLabelsManager. > ---------------------------------------------------------------------------------------------------------------------- > > Key: YARN-2753 > URL: https://issues.apache.org/jira/browse/YARN-2753 > Project: Hadoop YARN > Issue Type: Sub-task > Reporter: zhihai xu > Assignee: zhihai xu > Attachments: YARN-2753.000.patch, YARN-2753.001.patch, YARN-2753.002.patch, YARN-2753.003.patch > > > CommonNodeLabelsManager#addToCluserNodeLabels should not change the value in labelCollections if the key already exists otherwise the Label.resource will be changed(reset). > potential NPE(NullPointerException) in checkRemoveLabelsFromNode of CommonNodeLabelsManager. > It because when a Node is created, Node.labels can be null. > In this case, nm.labels; may be null. > So we need check originalLabels not null before use it(originalLabels.containsAll). -- This message was sent by Atlassian JIRA (v6.3.4#6332)