From 6da0151081792ae030140008dce5f8b58d56430d Mon Sep 17 00:00:00 2001 From: Zhankun Tang Date: Tue, 18 Jun 2019 12:23:52 +0800 Subject: [PATCH] YARN-9584. Should put initializeProcessTrees method call before get pid. Contributed by Wanqiang Ji. (cherry picked from commit 67414a1a80039e70e0afc1de171831a6e981f37a) --- .../containermanager/monitor/ContainersMonitorImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java index 952e4ef03ee..5ebee86b9d1 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/ContainersMonitorImpl.java @@ -430,11 +430,10 @@ public class ContainersMonitorImpl extends AbstractService implements ContainerId containerId = entry.getKey(); ProcessTreeInfo ptInfo = entry.getValue(); try { - String pId = ptInfo.getPID(); - // Initialize uninitialized process trees initializeProcessTrees(entry); + String pId = ptInfo.getPID(); if (pId == null || !isResourceCalculatorAvailable()) { continue; // processTree cannot be tracked }