Github user obermeier commented on a diff in the pull request:
https://github.com/apache/spark/pull/19408#discussion_r150907312
--- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
@@ -982,7 +982,19 @@ private[spark] object Utils extends Logging {
return cached
}
- val indx: Int = hostPort.lastIndexOf(':')
+ val indx: Int =
+ // Interpret hostPort as literal IPv6 address if it contains
multiple colons.
+ // IPv6 addresses enclosed in square brackets like [::1]:123 are
not included.
+ // scalastyle:off SingleSpaceBetweenRParenAndLCurlyBrace
+ if (hostPort.matches("(([0-9a-fA-F]*):([0-9a-fA-F]*)){2,}")) {
+ // scalastyle:on SingleSpaceBetweenRParenAndLCurlyBrace
+ -1
+ } else {
+ // Else last colon defines start of port definition
+ hostPort.lastIndexOf(':')
+ }
+
+
// This is potentially broken - when dealing with ipv6 addresses for
example, sigh ...
// but then hadoop does not support ipv6 right now.
// For now, we assume that if port exists, then it is valid - not
check if it is an int > 0
--- End diff --
I removed this comment
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]