crowdmob/kafka — pull request #1 by noverloop (2013-08-14 12:04:00+00:00)
Title: Make broker connection robust to connection resets from kafka

When a connection reset happens in kafka like this one:

```
[2013-08-14 11:48:51,352] ERROR Closing socket for /10.0.2.2 because of error (kafka.network.Processor)
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:225)
at sun.nio.ch.IOUtil.read(IOUtil.java:198)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:375)
at kafka.utils.Utils$.read(Utils.scala:538)
at kafka.network.BoundedByteBufferReceive.readFrom(BoundedByteBufferReceive.scala:54)
at kafka.network.Processor.read(SocketServer.scala:311)
at kafka.network.Processor.run(SocketServer.scala:214)
at java.lang.Thread.run(Thread.java:724)
[2013-08-14 11:49:09,709] INFO Closing socket connection to /10.0.2.2. (kafka.network.Processor)

```

Make sure the connection enters the connection recovery loop.