PYTHON-5668 - Merge backpressure branch into mainline#2729
PYTHON-5668 - Merge backpressure branch into mainline#2729
Conversation
pymongo/asynchronous/client_bulk.py
Outdated
| and "errorLabels" in error.details | ||
| and isinstance(error.details["errorLabels"], list) | ||
| and "RetryableError" in error.details["errorLabels"] | ||
| ) |
There was a problem hiding this comment.
Could this ^ be error.has_error_label("RetryableError") with an isinstance(error, PyMongoError) guard?
There was a problem hiding this comment.
Can you expand on what this if statement would look like with that change?
There was a problem hiding this comment.
retryable_label_error = (
isinstance(error, PyMongoError)
and error.has_error_label("RetryableError")
)
There was a problem hiding this comment.
Good catch, that is a clarity and consistency improvement.
| isinstance(exc, OperationFailure) | ||
| and exc_code not in helpers_shared._RETRYABLE_ERROR_CODES | ||
| ) | ||
| ) |
There was a problem hiding this comment.
Suggest minor improvement to conditional clarity via additional parenthesis wrapping the outer or condition:
if (
not self._client.options.retry_reads
or (
not always_retryable
and (
self._is_not_eligible_for_retry()
or (
isinstance(exc, OperationFailure)
and exc_code not in helpers_shared._RETRYABLE_ERROR_CODES
)
)
)
):
pymongo/asynchronous/mongo_client.py
Outdated
|
|
||
| self._always_retryable = always_retryable | ||
| if overloaded: | ||
| delay = self._retry_policy.backoff(self._attempt_number) if overloaded else 0 |
There was a problem hiding this comment.
Already inside if overloaded
sleepyStick
left a comment
There was a problem hiding this comment.
phew big PR -- sorry it took me a hot minute to review it, i've been looking at bits of it throughout the day (between workloads lol ;-;) just one change but otherwise its good! Great work!
| change-streams|change_streams) | ||
| cpjson change-streams/tests/ change_streams/ | ||
| ;; | ||
| client-backpressure|client_backpressure) |
There was a problem hiding this comment.
Good catch! At long last
sleepyStick
left a comment
There was a problem hiding this comment.
woo!!! one step closer to being done with backpressure!
PYTHON-5668
Changes in this PR
Merge backpressure branch into master.
Reviewers can ignore all spec test changes. Focus on the actual code changes within
pymongo/and the prose tests.Test Plan
Checklist
Checklist for Author
Checklist for Reviewer