DRIVERS-3535 - Client Backpressure with retryAfterMS#1953
Conversation
Co-authored-by: Sergey Zelenov <sergey.zelenov@mongodb.com>
tadjik1
left a comment
There was a problem hiding this comment.
Thanks @NoahStapp, everything looks good! I will keep an eye on retryAfterMS max value, once it's set I'll approve this PR.
Co-authored-by: Steven Silvester <steve.silvester@mongodb.com>
|
After further discussion with Server, I've simplified the backoff calculation formula to remove the custom jitter for |
|
As a note, the two failing checks should be fixed by #1958 |
| retry_after_ms = exc.retry_after_ms | ||
| if retry_after_ms: | ||
| retry_after = retry_after / 1000 # Convert from milliseconds to seconds | ||
| backoff = jitter * min(MAX_BACKOFF, retry_after * 2 ** (attempt - 1)) |
There was a problem hiding this comment.
jitter is undefined in this if block, should it be hoisted to above it?
|
|
||
| # If present on the error, retryAfterMS sets the base backoff | ||
| retry_after_ms = exc.retry_after_ms | ||
| if retry_after_ms: |
There was a problem hiding this comment.
I think the retry_after should be set as BASE_BACKOFF, then set to the new value if retry_after_ms is given, then use a single line to set the backoff
There was a problem hiding this comment.
🙏 even more concise, thanks!
Please complete the following before merging:
clusters).