Github user scwf commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2623#discussion_r18333694
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -1437,7 +1437,13 @@ private[spark] object Utils extends Logging {
         val serviceString = if (serviceName.isEmpty) "" else s" '$serviceName'"
         for (offset <- 0 to maxRetries) {
           // Do not increment port if startPort is 0, which is treated as a 
special port
    -      val tryPort = if (startPort == 0) startPort else (startPort + 
offset) % 65536
    +      val _tryPort = if (startPort == 0) startPort else (startPort + 
offset) % 65536
    --- End diff --
    
    I am doubt what the diff between ```((startPort + offset - 1024) % (65536 - 
1024)) + 1024``` and ```(startPort + offset) % 65536''', it seems only when 
startPort + offset  = 65536 this two formula get different values.
    I think the key point is whether port(1 - 1024) should allowed in spark. If 
allowed here we do not need change ```tryPort``` and we should catch the ``` 
java.net.SocketException: Permission denied``` to let it go on trying next port
    how do you think so? 
    



---
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]

Reply via email to