Skip to content

Commit ea11a03

Browse files
committed
Catch all exceptions caused by BindExceptions
Looks like the actual exception thrown sometimes is org.jboss.netty.channel.ChannelException: Failed to bind to: localhost/127.0.0.1:60550, which is not a java.net.BindException. We should catch these too.
1 parent 54a0ca0 commit ea11a03

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

external/flume/src/test/scala/org/apache/spark/streaming/flume/FlumePollingStreamSuite.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import org.apache.spark.streaming.dstream.ReceiverInputDStream
3535
import org.apache.spark.streaming.util.ManualClock
3636
import org.apache.spark.streaming.{TestSuiteBase, TestOutputStream, StreamingContext}
3737
import org.apache.spark.streaming.flume.sink._
38+
import org.apache.spark.util.Utils
3839

3940
class FlumePollingStreamSuite extends TestSuiteBase {
4041

@@ -67,7 +68,7 @@ class FlumePollingStreamSuite extends TestSuiteBase {
6768
test()
6869
testPassed = true
6970
} catch {
70-
case e: java.net.BindException =>
71+
case e: Exception if Utils.isBindCollision(e) =>
7172
logWarning("Exception when running flume polling test: " + e)
7273
attempt += 1
7374
}

0 commit comments

Comments
 (0)