Skip to content

Commit 54557f3

Browse files
carsonwangsrowen
authored andcommitted
[SPARK-8387] [FOLLOWUP ] [WEBUI] Update driver log URL to show only 4096 bytes
This is to follow up #6834 , update the driver log URL as well for consistency. Author: Carson Wang <carson.wang@intel.com> Closes #6878 from carsonwang/logUrl and squashes the following commits: 13be948 [Carson Wang] update log URL in YarnClusterSuite a0004f4 [Carson Wang] Update driver log URL to show only 4096 bytes
1 parent fdf63f1 commit 54557f3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

yarn/src/main/scala/org/apache/spark/scheduler/cluster/YarnClusterSchedulerBackend.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ private[spark] class YarnClusterSchedulerBackend(
115115
val httpScheme = if (yarnHttpPolicy == "HTTPS_ONLY") "https://" else "http://"
116116
val baseUrl = s"$httpScheme$httpAddress/node/containerlogs/$containerId/$user"
117117
logDebug(s"Base URL for logs: $baseUrl")
118-
driverLogs = Some(
119-
Map("stderr" -> s"$baseUrl/stderr?start=0", "stdout" -> s"$baseUrl/stdout?start=0"))
118+
driverLogs = Some(Map(
119+
"stderr" -> s"$baseUrl/stderr?start=-4096",
120+
"stdout" -> s"$baseUrl/stdout?start=-4096"))
120121
}
121122
}
122123
} catch {

yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnClusterSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ private object YarnClusterDriver extends Logging with Matchers {
376376
new URL(urlStr)
377377
val containerId = YarnSparkHadoopUtil.get.getContainerId
378378
val user = Utils.getCurrentUserName()
379-
assert(urlStr.endsWith(s"/node/containerlogs/$containerId/$user/stderr?start=0"))
379+
assert(urlStr.endsWith(s"/node/containerlogs/$containerId/$user/stderr?start=-4096"))
380380
}
381381
}
382382

0 commit comments

Comments
 (0)