You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by zuotingbing <gi...@git.apache.org> on 2017/01/17 10:05:36 UTC

[GitHub] spark pull request #16614: [SPARK-19260] Spaces in path parameter are not co...

GitHub user zuotingbing opened a pull request:

    https://github.com/apache/spark/pull/16614

    [SPARK-19260] Spaces in path parameter are not correctly handled with\u2026

    JIRA Issue: https://issues.apache.org/jira/browse/SPARK-19260
    
    ## What changes were proposed in this pull request?
    
    A space character in URI may be encoded as "%20".
    It seems that the string of URI expects to be decoded.
    
    ## How was this patch tested?
    
    manual tests
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zuotingbing/spark SPARK-19260

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/16614.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #16614
    
----
commit 91b7e3810fe195d9d14e98e3b1d2f1db235a480b
Author: zuotingbing <zu...@zte.com.cn>
Date:   2017-01-17T10:02:38Z

    [SPARK-19260] Spaces in path parameter are not correctly handled with HistoryServer

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #16614: [SPARK-19260] Spaces or "%20" in path parameter a...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/16614


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #16614: [SPARK-19260] Spaces in path parameter are not co...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16614#discussion_r96402251
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala ---
    @@ -93,10 +94,12 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)
       private val NUM_PROCESSING_THREADS = conf.getInt(SPARK_HISTORY_FS_NUM_REPLAY_THREADS,
         Math.ceil(Runtime.getRuntime.availableProcessors() / 4f).toInt)
     
    -  private val logDir = conf.getOption("spark.history.fs.logDirectory")
    +  private val logURIString = conf.getOption("spark.history.fs.logDirectory")
         .map { d => Utils.resolveURI(d).toString }
         .getOrElse(DEFAULT_LOG_DIR)
     
    +  private val logDir = URLDecoder.decode(logURIString, "UTF-8")
    --- End diff --
    
    Hm, this is either a local path, in which case it shouldn't be URI-escaped, or it's a URI, in which case it can be parsed with `java.net.URI` right? I think we take the latter approach in most other places in the code.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16614: [SPARK-19260] Spaces or "%20" in path parameter are not ...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:

    https://github.com/apache/spark/pull/16614
  
    Merged to master


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16614: [SPARK-19260] Spaces in path parameter are not correctly...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/16614
  
    Can one of the admins verify this patch?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16614: [SPARK-19260] Spaces or "%20" in path parameter are not ...

Posted by zuotingbing <gi...@git.apache.org>.
Github user zuotingbing commented on the issue:

    https://github.com/apache/spark/pull/16614
  
    Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16614: [SPARK-19260] Spaces or "%20" in path parameter are not ...

Posted by zuotingbing <gi...@git.apache.org>.
Github user zuotingbing commented on the issue:

    https://github.com/apache/spark/pull/16614
  
    @srowen Happy Chinese New Year !
    Sorry for the late reply. It sounds more sensible to test this behavior everywhere since all the test cases used the directory, right? Thank you for your patience and guidance. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #16614: [SPARK-19260] Spaces or "%20" in path parameter a...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16614#discussion_r97768039
  
    --- Diff: core/src/test/scala/org/apache/spark/deploy/history/FsHistoryProviderSuite.scala ---
    @@ -47,7 +47,7 @@ class FsHistoryProviderSuite extends SparkFunSuite with BeforeAndAfter with Matc
       private var testDir: File = null
     
       before {
    -    testDir = Utils.createTempDir()
    +    testDir = Utils.createTempDir(namePrefix = s"a b%20c+d")
    --- End diff --
    
    Hm, because this affects the whole suite, I wonder if it's more sensible to test this behavior once in a specific test case, rather than test the behavior everywhere. It works, and I don't have a big problem with it, just looks a little surprising to read.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16614: [SPARK-19260] Spaces or "%20" in path parameter are not ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/16614
  
    **[Test build #3543 has finished](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/3543/testReport)** for PR 16614 at commit [`ebca3ed`](https://github.com/apache/spark/commit/ebca3ed18de440a176f58588241045e8c346f447).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16614: [SPARK-19260] Spaces or "%20" in path parameter are not ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/16614
  
    **[Test build #3549 has started](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/3549/testReport)** for PR 16614 at commit [`23834a6`](https://github.com/apache/spark/commit/23834a6ec99ac7e8a8df9095ce523de0ede80aea).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16614: [SPARK-19260] Spaces or "%20" in path parameter are not ...

Posted by zuotingbing <gi...@git.apache.org>.
Github user zuotingbing commented on the issue:

    https://github.com/apache/spark/pull/16614
  
    Could you please merge to master and close this PR?
    Thanks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16614: [SPARK-19260] Spaces or "%20" in path parameter are not ...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:

    https://github.com/apache/spark/pull/16614
  
    Ping @zuotingbing 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16614: [SPARK-19260] Spaces or "%20" in path parameter are not ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/16614
  
    **[Test build #3549 has finished](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/3549/testReport)** for PR 16614 at commit [`23834a6`](https://github.com/apache/spark/commit/23834a6ec99ac7e8a8df9095ce523de0ede80aea).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16614: [SPARK-19260] Spaces or "%20" in path parameter are not ...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:

    https://github.com/apache/spark/pull/16614
  
    @zuotingbing see my last comment. I can fix this separately if you aren't able to follow up


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #16614: [SPARK-19260] Spaces or "%20" in path parameter are not ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/16614
  
    **[Test build #3543 has started](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/3543/testReport)** for PR 16614 at commit [`ebca3ed`](https://github.com/apache/spark/commit/ebca3ed18de440a176f58588241045e8c346f447).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #16614: [SPARK-19260] Spaces in path parameter are not co...

Posted by zuotingbing <gi...@git.apache.org>.
Github user zuotingbing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16614#discussion_r97032463
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala ---
    @@ -93,10 +94,12 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)
       private val NUM_PROCESSING_THREADS = conf.getInt(SPARK_HISTORY_FS_NUM_REPLAY_THREADS,
         Math.ceil(Runtime.getRuntime.availableProcessors() / 4f).toInt)
     
    -  private val logDir = conf.getOption("spark.history.fs.logDirectory")
    +  private val logURIString = conf.getOption("spark.history.fs.logDirectory")
         .map { d => Utils.resolveURI(d).toString }
         .getOrElse(DEFAULT_LOG_DIR)
     
    +  private val logDir = URLDecoder.decode(logURIString, "UTF-8")
    --- End diff --
    
    Yes you are right. I think the logic in Utils:resolveURI(path: String) seems not correct.  When the path is "hdfs://namenode:9000/a b",  "new URI(path)" will throws URISyntaxException and return a URI with "file" scheme instead of \u201chdfs\u201d scheme . 
    To avoid this maybe we can use Path.getFileSystem to get the right filesystem. Thank you.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org