Skip to content

Commit c6278be

Browse files
committed
Introducing spark.ui.requestHeaderSize
1 parent bbbdaa8 commit c6278be

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

core/src/main/scala/org/apache/spark/internal/config/package.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,13 @@ package object config {
570570
.stringConf
571571
.createOptional
572572

573+
private[spark] val UI_REQUEST_HEADER_SIZE =
574+
ConfigBuilder("spark.ui.requestHeaderSize")
575+
.doc("Value for HTTP request header size in bytes.")
576+
.bytesConf(ByteUnit.BYTE)
577+
.createWithDefaultString("8k")
578+
579+
573580
private[spark] val EXTRA_LISTENERS = ConfigBuilder("spark.extraListeners")
574581
.doc("Class names of listeners to add to SparkContext during initialization.")
575582
.stringConf

core/src/main/scala/org/apache/spark/ui/JettyUtils.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,13 +356,15 @@ private[spark] object JettyUtils extends Logging {
356356

357357
(connector, connector.getLocalPort())
358358
}
359+
val httpConfig = new HttpConfiguration()
360+
httpConfig.setRequestHeaderSize(conf.get(UI_REQUEST_HEADER_SIZE).toInt)
359361

360362
// If SSL is configured, create the secure connector first.
361363
val securePort = sslOptions.createJettySslContextFactory().map { factory =>
362364
val securePort = sslOptions.port.getOrElse(if (port > 0) Utils.userPort(port, 400) else 0)
363365
val secureServerName = if (serverName.nonEmpty) s"$serverName (HTTPS)" else serverName
364366
val connectionFactories = AbstractConnectionFactory.getFactories(factory,
365-
new HttpConnectionFactory())
367+
new HttpConnectionFactory(httpConfig))
366368

367369
def sslConnect(currentPort: Int): (ServerConnector, Int) = {
368370
newConnector(connectionFactories, currentPort)
@@ -377,7 +379,7 @@ private[spark] object JettyUtils extends Logging {
377379

378380
// Bind the HTTP port.
379381
def httpConnect(currentPort: Int): (ServerConnector, Int) = {
380-
newConnector(Array(new HttpConnectionFactory()), currentPort)
382+
newConnector(Array(new HttpConnectionFactory(httpConfig)), currentPort)
381383
}
382384

383385
val (httpConnector, httpPort) = Utils.startServiceOnPort[ServerConnector](port, httpConnect,

docs/configuration.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,15 @@ Apart from these, the following properties are also available, and may be useful
973973
<br /><code>spark.com.test.filter1.param.name2=bar</code>
974974
</td>
975975
</tr>
976+
<tr>
977+
<td><code>spark.ui.requestHeaderSize</code></td>
978+
<td>8k</td>
979+
<td>
980+
The HTTP request header size, in bytes unless otherwise specified.
981+
This setting applied for the Spark History Server too.
982+
<td>
983+
</tr>
984+
976985
</table>
977986

978987
### Compression and Serialization

0 commit comments

Comments
 (0)