YARN-9584. Should put initializeProcessTrees method call before get pid. Contributed by Wanqiang Ji.

(cherry picked from commit 67414a1a80)
This commit is contained in:
Zhankun Tang 2019-06-18 12:23:52 +08:00
parent 79f8e4d5bc
commit 6da0151081
1 changed files with 1 additions and 2 deletions

View File

@ -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
}