basho/riak-python-client — pull request #258 by seancribbs (2013-06-14 21:29:03+00:00)
Title: Ensure that errors are propagated after retries are exhausted.

Before this change, as long as the raised error in a client operation was always eligible for retry, the result was that the retried operation would return `None` after hitting the `RETRY_COUNT`. This produced strange masking effects, including returning an empty list from MapReduce operations that failed.

Now the last exception will be re-raised when the retries have been exhausted, which was the original desired behavior.

While investigating this behavior, I also discovered that the PB socket would attempt to connect while allocating a new element in the pool, which meant that connection would happen outside the `try ... except` inside `Pool.take()`. This meant that failed connections would mean instant propagation of the connection error, avoiding the retry logic. The transport was changed to connect on first request so that it has analogous behavior to the HTTP transport.

Closes #218.