Skip to content

Commit

Permalink
Fail block fetches if client connection fails
Browse files Browse the repository at this point in the history
  • Loading branch information
aarondav committed Oct 29, 2014
1 parent 2b0d1c0 commit 4a204b8
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,14 @@ class NettyBlockTransferService(conf: SparkConf) extends BlockTransferService {
port: Int,
blockIds: Seq[String],
listener: BlockFetchingListener): Unit = {
val client = clientFactory.createClient(hostname, port)
new NettyBlockFetcher(serializer, client, blockIds, listener).start()
try {
val client = clientFactory.createClient(hostname, port)
new NettyBlockFetcher(serializer, client, blockIds, listener).start()
} catch {
case e: Exception =>
logError("Exception while beginning fetchBlocks", e)
blockIds.foreach(listener.onBlockFetchFailure(_, e))
}
}

override def hostName: String = Utils.localHostName()
Expand Down

0 comments on commit 4a204b8

Please sign in to comment.