From df2ae271ccfbd562f9132d5ba795e638d38cb04a 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 2b99cc7254b..5e7d67e482c 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 @@ -428,11 +428,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 }