Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/3841#discussion_r22828492
--- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
@@ -1709,17 +1706,20 @@ private[spark] object Utils extends Logging {
* Each subsequent attempt uses 1 + the port used in the previous
attempt (unless the port is 0).
*
* @param startPort The initial port to start the service on.
- * @param maxRetries Maximum number of retries to attempt.
- * A value of 3 means attempting ports n, n+1, n+2,
and n+3, for example.
* @param startService Function to start service on a given port.
* This is expected to throw java.net.BindException
on port collision.
+ * @param conf Used to get maximum number of retries.
+ * @param serviceName Name of the service.
*/
def startServiceOnPort[T](
startPort: Int,
startService: Int => (T, Int),
- serviceName: String = "",
- maxRetries: Int = portMaxRetries): (T, Int) = {
+ conf: SparkConf,
+ serviceName: String = ""
+ ): (T, Int) = {
val serviceString = if (serviceName.isEmpty) "" else s" '$serviceName'"
+ val maxRetries = portMaxRetries(conf)
+ logInfo(s"Starting service$serviceString on port $startPort with
maximum $maxRetries retries. ")
--- End diff --
I think it's better to not log this. It'll get fairly noisy if there are
many retries.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]