GitHub user attilapiros opened a pull request:

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

    [SPARK-26118][WEB UI] Introducing spark.ui.requestHeaderSize for setting 
HTTP requestHeaderSize

    ## What changes were proposed in this pull request?
    
    Introducing spark.ui.requestHeaderSize for configuring Jetty's HTTP 
requestHeaderSize.
    This way long authorization field does not lead to HTTP 413.
    
    ## How was this patch tested?
    
    Manually with curl (which version must be at least 7.55).
    
    With the original default value (8k limit):
    
    ```bash
    $ ./sbin/start-history-server.sh
    starting org.apache.spark.deploy.history.HistoryServer, logging to 
/Users/attilapiros/github/spark/logs/spark-attilapiros-org.apache.spark.deploy.history.HistoryServer-1-apiros-MBP.lan.out
    
    $ echo -n "X-Custom-Header: " > cookie
    $ printf 'A%.0s' {1..9500} >> cookie
    
    $ curl  -H cookie http://458apiros-MBP.lan:18080/
    <h1>Bad Message 431</h1><pre>reason: Request Header Fields Too Large</pre>
    
    $ tail -1 
/Users/attilapiros/github/spark/logs/spark-attilapiros-org.apache.spark.deploy.history.HistoryServer-1-apiros-MBP.lan.out
    18/11/19 21:24:28 WARN HttpParser: Header is too large 8193>8192
    ```
    
    After:
    
    ```bash
    $ echo spark.ui.requestHeaderSize=10000 > history.properties
    
    $ ./sbin/start-history-server.sh --properties-file history.properties
    starting org.apache.spark.deploy.history.HistoryServer, logging to 
/Users/attilapiros/github/spark/logs/spark-attilapiros-org.apache.spark.deploy.history.HistoryServer-1-apiros-MBP.lan.out
    
    $ curl  -H cookie http://458apiros-MBP.lan:18080/
    <!DOCTYPE html><html>
          <head>...
             <link rel="shortcut icon" 
href="/static/spark-logo-77x50px-hd.png"></link>
            <title>History Server</title>
          </head>
          <body>
    ...
    ```
    (cherry picked from commit ab61ddb34d58ab5701191c8fd3a24a62f6ebf37b)

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

    $ git pull https://github.com/attilapiros/spark julianOffByDays-2.2

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

    https://github.com/apache/spark/pull/23115.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 #23115
    
----
commit 9513b3f0de8d3f88eb488411f7c412e45689013f
Author: “attilapiros” <piros.attila.zsolt@...>
Date:   2018-11-20T14:56:22Z

    [SPARK-26118][WEB UI] Introducing spark.ui.requestHeaderSize for setting 
HTTP requestHeaderSize
    
    Introducing spark.ui.requestHeaderSize for configuring Jetty's HTTP 
requestHeaderSize.
    This way long authorization field does not lead to HTTP 413.
    
    Manually with curl (which version must be at least 7.55).
    
    With the original default value (8k limit):
    
    ```bash
    $ ./sbin/start-history-server.sh
    starting org.apache.spark.deploy.history.HistoryServer, logging to 
/Users/attilapiros/github/spark/logs/spark-attilapiros-org.apache.spark.deploy.history.HistoryServer-1-apiros-MBP.lan.out
    
    $ echo -n "X-Custom-Header: " > cookie
    $ printf 'A%.0s' {1..9500} >> cookie
    
    $ curl  -H cookie http://458apiros-MBP.lan:18080/
    <h1>Bad Message 431</h1><pre>reason: Request Header Fields Too Large</pre>
    
    $ tail -1 
/Users/attilapiros/github/spark/logs/spark-attilapiros-org.apache.spark.deploy.history.HistoryServer-1-apiros-MBP.lan.out
    18/11/19 21:24:28 WARN HttpParser: Header is too large 8193>8192
    ```
    
    After:
    
    ```bash
    $ echo spark.ui.requestHeaderSize=10000 > history.properties
    
    $ ./sbin/start-history-server.sh --properties-file history.properties
    starting org.apache.spark.deploy.history.HistoryServer, logging to 
/Users/attilapiros/github/spark/logs/spark-attilapiros-org.apache.spark.deploy.history.HistoryServer-1-apiros-MBP.lan.out
    
    $ curl  -H cookie http://458apiros-MBP.lan:18080/
    <!DOCTYPE html><html>
          <head>...
             <link rel="shortcut icon" 
href="/static/spark-logo-77x50px-hd.png"></link>
            <title>History Server</title>
          </head>
          <body>
    ...
    ```
    (cherry picked from commit ab61ddb34d58ab5701191c8fd3a24a62f6ebf37b)

----


---

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

Reply via email to