Skip to content

Ensure that errors are propagated after retries are exhausted. #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 20, 2013

Conversation

seancribbs
Copy link

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.

Sean Cribbs added 5 commits June 14, 2013 15:21
This prevents exceptions from occuring while trying to create a new
transport in the pool, which happens outside a try/except. The result
is the same behavior as HTTP, which delays opening a connection until
the first request.
This prevents masking of errors when the loop falls through to its
completion, all tries raising BadResource. The previous behavior was
that the function doesn't return any value, essentially returning
None.
Also, don't penalize a node that has some unspecified unretryable
exception.
@ghost ghost assigned seancribbs Jun 14, 2013
@shuhaowu
Copy link
Contributor

Looks awesome! 👍

@hazen
Copy link

hazen commented Jun 20, 2013

Try as I might, I can't seem to find problems here. Test even works. 👍

seancribbs pushed a commit that referenced this pull request Jun 20, 2013
Ensure that errors are propagated after retries are exhausted.
@seancribbs seancribbs merged commit bd0e67e into master Jun 20, 2013
@seancribbs seancribbs deleted the gh218-http-masks-errors branch June 20, 2013 22:21
@seancribbs seancribbs removed their assignment May 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Errors are masked
3 participants