mesos/spark — pull request #356 by shane-huang (2013-01-08 06:56:04+00:00)
Title: Fix an issue in ConnectionManager where sendMessage may create too many unnecessary connections

In ConnectionManager, sendMessage creates a new SendingConnection when connection host key is not found in connectionsById. But there might be too many unnecessary connections created before connectionsById is updated in the connection-manager-thread.run. In out test ConnectionMangerTest fails on "connection reset by peer" or "timeout" when there're too many message sending threads. This patch reuse the connections and fix this issue.