Ensure that errors are propagated after retries are exhausted. #258
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theRETRY_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
insidePool.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.