Skip to content

Commit 6ff9576

Browse files
committed
YARN-11891. Yarn logs command hangs for running applications
1 parent adda712 commit 6ff9576

File tree

1 file changed

+4
-0
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli

1 file changed

+4
-0
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/LogsCLI.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,9 @@ private List<Pair<ContainerLogFileInfo, String>> getContainerLogFiles(
538538
JSONArray array = new JSONArray();
539539
String entity = response.readEntity(String.class);
540540
JSONObject json = new JSONObject(entity);
541+
if (json.has("containerLogsInfoes")) {
542+
json = json.getJSONObject("containerLogsInfoes");
543+
}
541544
if (!json.has("containerLogsInfo")) {
542545
return logFileInfos;
543546
}
@@ -1531,6 +1534,7 @@ public void filter(ClientRequestContext requestContext) throws IOException {
15311534
}
15321535
// check if a URL is reachable
15331536
checkUrlConnectivity(uri);
1537+
return;
15341538
} catch (Exception e) {
15351539
leftRetries--;
15361540
if (leftRetries <= 0) {

0 commit comments

Comments
 (0)