basho/riak-java-client — pull request #399 by broach (2014-03-26 05:00:03+00:00)
Title: Improved health check logic

My initial cut at determining whether a health check should be performed
only relied on connections being closed by Riak. I actually missed
connections being refused which should have also been counted.

This adds (consecutive) failed connection attempts as well as
consecutive RpbErrorMsg responses to the logic that determines whether
a health check should be performed.

For testing this also adds a new listener to the network fixture that
reads a riak PB message then replies with RpbErrorMsg. Tests are
added to demonstrate both failed connection attempts and failed
riak operations will trigger a health check.