Skip to content

Commit

Permalink
[SPARK-3756] [Core]check exception is caused by an address-port colli…
Browse files Browse the repository at this point in the history
…sion properly

Jetty server use MultiException to handle exceptions when start server
refer https://github.com/eclipse/jetty.project/blob/jetty-8.1.14.v20131031/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java

So in ```isBindCollision``` add the logical to cover MultiException

Author: scwf <wangfei1@huawei.com>

Closes apache#2611 from scwf/fix-isBindCollision and squashes the following commits:

984cb12 [scwf] optimize the fix
3a6c849 [scwf] fix bug in isBindCollision
  • Loading branch information
scwf authored and pwendell committed Oct 1, 2014
1 parent 6390aae commit 2fedb5d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/main/scala/org/apache/spark/util/Utils.scala
Expand Up @@ -23,6 +23,8 @@ import java.nio.ByteBuffer
import java.util.{Properties, Locale, Random, UUID}
import java.util.concurrent.{ThreadFactory, ConcurrentHashMap, Executors, ThreadPoolExecutor}

import org.eclipse.jetty.util.MultiException

import scala.collection.JavaConversions._
import scala.collection.Map
import scala.collection.mutable.ArrayBuffer
Expand Down Expand Up @@ -1470,6 +1472,7 @@ private[spark] object Utils extends Logging {
return true
}
isBindCollision(e.getCause)
case e: MultiException => e.getThrowables.exists(isBindCollision)
case e: Exception => isBindCollision(e.getCause)
case _ => false
}
Expand Down

0 comments on commit 2fedb5d

Please sign in to comment.