basho/riak-python-client — pull request #223 by avalente (2013-03-12 11:37:43+00:00)
Title: Reconnection improvements

I made some small improvements on the reconnection behaviour:

1. before retrying, it waits a random, small amount of time (max 500ms), since the issue may be a network glitch, a momentary lack of client's resources and so on
2. sometimes, when the riak node went down in the middle of an operation, the operation was not retried when using the pbc transport, while it was with the http one. The issue is that the error raised is a generic "_RiakError_", raised because the _recv()_ didn't receive the expected data; in that circumstance the operation isn't marked as "retryable"

A fully functional test is attached, I didn't find a sensible way to produce a unit test.