You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "watson xi (JIRA)" <ji...@apache.org> on 2015/10/28 20:00:30 UTC

[jira] [Commented] (SPARK-11115) Host verification is not correct for IPv6

    [ https://issues.apache.org/jira/browse/SPARK-11115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14979023#comment-14979023 ] 

watson xi commented on SPARK-11115:
-----------------------------------

I keep having this problem myself. It only happens itermitently and I have no idea why. Not accessing any remote hosts.

> Host verification is not correct for IPv6
> -----------------------------------------
>
>                 Key: SPARK-11115
>                 URL: https://issues.apache.org/jira/browse/SPARK-11115
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Core
>    Affects Versions: 1.5.1
>         Environment: CentOS 6.7, Java 1.8.0_25, dual stack IPv4 + IPv6
>            Reporter: Thomas Dudziak
>            Priority: Critical
>
> When running Spark with -Djava.net.preferIPv6Addresses=true, I get this error:
> 15/10/14 14:36:01 ERROR SparkContext: Error initializing SparkContext.
> java.lang.AssertionError: assertion failed: Expected hostname
> 	at scala.Predef$.assert(Predef.scala:179)
> 	at org.apache.spark.util.Utils$.checkHost(Utils.scala:805)
> 	at org.apache.spark.storage.BlockManagerId.<init>(BlockManagerId.scala:48)
> 	at org.apache.spark.storage.BlockManagerId$.apply(BlockManagerId.scala:107)
> 	at org.apache.spark.storage.BlockManager.initialize(BlockManager.scala:190)
> 	at org.apache.spark.SparkContext.<init>(SparkContext.scala:528)
> 	at org.apache.spark.repl.SparkILoop.createSparkContext(SparkILoop.scala:1017)
> Looking at the code in question, it seems that the code will only work for IPv4 as it assumes ':' can't be part of the hostname (which it clearly can for IPv6 addresses).
> Instead, the code should probably use Guava's HostAndPort class, i.e.:
>   def checkHost(host: String, message: String = "") {
>     assert(!HostAndPort.fromString(host).hasPort, message)
>   }
>   def checkHostPort(hostPort: String, message: String = "") {
>     assert(HostAndPort.fromString(hostPort).hasPort, message)
>   }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org