-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-16987] [None] Add spark-default.conf property to define https port for spark history server #15652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-16987] [None] Add spark-default.conf property to define https port for spark history server #15652
Changes from 7 commits
955a82c
8ac0369
47108b4
3964609
1e2c985
935415c
62aeb6c
bd945aa
9d69f02
30a2927
83df9bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -308,14 +308,22 @@ private[spark] object JettyUtils extends Logging { | |
|
|
||
| sslOptions.createJettySslContextFactory().foreach { factory => | ||
| // If the new port wraps around, do not try a privileged port. | ||
|
|
||
| require(sslOptions.port == 0 || (1024 <= sslOptions.port && sslOptions.port < 65536)) | ||
|
|
||
| val securePort = | ||
| if (currentPort != 0) { | ||
| (currentPort + 400 - 1024) % (65536 - 1024) + 1024 | ||
| if (1024 < sslOptions.port && sslOptions.port < 65536) { | ||
| sslOptions.port | ||
| } else { | ||
| (currentPort + 400 - 1024) % (65536 - 1024) + 1024 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a comment in the code explaining the math done here ? It will help readability of the code. |
||
| } | ||
| } else { | ||
| 0 | ||
| } | ||
| val scheme = "https" | ||
| // Create a connector on port securePort to listen for HTTPS requests | ||
| // Create a connector on port securePort to listen for HTTPS requests. | ||
|
|
||
| val connector = new ServerConnector(server, factory) | ||
| connector.setPort(securePort) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1663,6 +1663,15 @@ Apart from these, the following properties are also available, and may be useful | |
| page. | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
| <td><code>spark.ssl.port</code></td> | ||
| <td>0</td> | ||
| <td> | ||
| Port number to listen on for SSL connections. | ||
| Default value of 0 means the port will be determined automatically. | ||
| Attention that the port should be separated for each particular protocols. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be clearer to write something like "Note that the SSL port for individual services can be overridden by setting values like
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the code above you are ensuring that the SSL port is always between 1024 and 65536. You could document that here as "allowed range of values".
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it's clear what the last sentence means. I'd either remove it or say something like "the port can be specified for services individually, with properties like |
||
| </td> | ||
| </tr> | ||
| <tr> | ||
| <td><code>spark.ssl.needClientAuth</code></td> | ||
| <td>false</td> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition should only happen when the port is 0 right? given the
requireabove. It would be clearer to check against 0 only.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the
require()above you have1024 <= sslOptions.portbut in thisif()you have1024 < sslOptions.port. Just wanted to check if thats intentional.