From a4dea9de142ec31fba6a904fd3bd69689df4e29c Mon Sep 17 00:00:00 2001 From: Eric Payne Date: Wed, 13 Jan 2021 19:44:26 +0000 Subject: [PATCH] YARN-4589: Diagnostics for localization timeouts is lacking. Contributed by Chang Li (lichangleo) and Jim Brennan (Jim_Brennan) (cherry picked from commit a093bd859da0d1f2834f873d4dbe2bbd2f00f2d2) --- .../containermanager/container/ContainerImpl.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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/container/ContainerImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/container/ContainerImpl.java index e1546d4478b..52414999100 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/container/ContainerImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/container/ContainerImpl.java @@ -23,6 +23,7 @@ import java.io.IOException; import java.net.URISyntaxException; import java.nio.ByteBuffer; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Date; @@ -1219,6 +1220,15 @@ public class ContainerImpl implements Container { container.resourceSet.addResources(ctxt.getLocalResources()); container.dispatcher.getEventHandler().handle( new ContainerLocalizationRequestEvent(container, req)); + // Get list of resources for logging + List resourcePaths = new ArrayList<>(); + for (Collection rsrcReqList : req.values()) { + for (LocalResourceRequest rsrc : rsrcReqList) { + resourcePaths.add(rsrc.getPath().toString()); + } + } + LOG.info("Container " + container.getContainerId() + + " is localizing: " + resourcePaths); } catch (URISyntaxException e) { // malformed resource; abort container launch LOG.warn("Failed to parse resource-request", e);