Repository: spark
Updated Branches:
  refs/heads/branch-1.6 18661a2bb -> 93a55f3df


[SPARK-13142][WEB UI] Problem accessing Web UI /logPage/ on Microsoft Windows

Due to being on a Windows platform I have been unable to run the tests as 
described in the "Contributing to Spark" instructions. As the change is only to 
two lines of code in the Web UI, which I have manually built and tested, I am 
submitting this pull request anyway. I hope this is OK.

Is it worth considering also including this fix in any future 1.5.x releases 
(if any)?

I confirm this is my own original work and license it to the Spark project 
under its open source license.

Author: markpavey <mark.pa...@thefilter.com>

Closes #11135 from markpavey/JIRA_SPARK-13142_WindowsWebUILogFix.

(cherry picked from commit 374c4b2869fc50570a68819cf0ece9b43ddeb34b)
Signed-off-by: Sean Owen <so...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/93a55f3d
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/93a55f3d
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/93a55f3d

Branch: refs/heads/branch-1.6
Commit: 93a55f3df3c9527ecf4143cb40ac7212bc3a975a
Parents: 18661a2
Author: markpavey <mark.pa...@thefilter.com>
Authored: Sat Feb 13 08:39:43 2016 +0000
Committer: Sean Owen <so...@cloudera.com>
Committed: Sat Feb 13 08:39:55 2016 +0000

----------------------------------------------------------------------
 .../main/scala/org/apache/spark/deploy/worker/ui/LogPage.scala   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/93a55f3d/core/src/main/scala/org/apache/spark/deploy/worker/ui/LogPage.scala
----------------------------------------------------------------------
diff --git 
a/core/src/main/scala/org/apache/spark/deploy/worker/ui/LogPage.scala 
b/core/src/main/scala/org/apache/spark/deploy/worker/ui/LogPage.scala
index 5a1d06e..15f88e7 100644
--- a/core/src/main/scala/org/apache/spark/deploy/worker/ui/LogPage.scala
+++ b/core/src/main/scala/org/apache/spark/deploy/worker/ui/LogPage.scala
@@ -30,7 +30,7 @@ import org.apache.spark.util.logging.RollingFileAppender
 
 private[ui] class LogPage(parent: WorkerWebUI) extends WebUIPage("logPage") 
with Logging {
   private val worker = parent.worker
-  private val workDir = parent.workDir
+  private val workDir = new File(parent.workDir.toURI.normalize().getPath)
   private val supportedLogTypes = Set("stderr", "stdout")
 
   def renderLog(request: HttpServletRequest): String = {
@@ -138,7 +138,7 @@ private[ui] class LogPage(parent: WorkerWebUI) extends 
WebUIPage("logPage") with
     }
 
     // Verify that the normalized path of the log directory is in the working 
directory
-    val normalizedUri = new URI(logDirectory).normalize()
+    val normalizedUri = new File(logDirectory).toURI.normalize()
     val normalizedLogDir = new File(normalizedUri.getPath)
     if (!Utils.isInDirectory(workDir, normalizedLogDir)) {
       return ("Error: invalid log directory " + logDirectory, 0, 0, 0)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to