basho/riak-java-client — pull request #343 by broach (2013-12-27 17:33:02+00:00)
Title: Reworked channel handling in RiakNode.

This addresses #337

At some point Netty changed its behavior to where IOExceptions
(e.g. connection reset by peer) are no longer sent as exceptions
down the pipeline. Instead the channel simply closes and any
listeners to the close future are notified. In addition, you have
no idea what happened; the future.cause() will always return null.

To adjust for this and improve the channel handling in general I've
refactored RiakNode.

* The inUse list no longer exists. A channel is either in available
or is the key in the inProgress Map.
* There are now two different close future listeners; one for when
a channel is in available, and another for when it is in progress.
* The write listener adds the in progress close listener once it succeeds.