Skip to content

PYTHON-5767 Implement DRIVERS-3427 phase 1 rollout changes#2739

Draft
Jibola wants to merge 9 commits intomongodb:backpressurefrom
Jibola:backpressure
Draft

PYTHON-5767 Implement DRIVERS-3427 phase 1 rollout changes#2739
Jibola wants to merge 9 commits intomongodb:backpressurefrom
Jibola:backpressure

Conversation

@Jibola
Copy link
Contributor

@Jibola Jibola commented Mar 24, 2026

Summary

  • Change MAX_RETRIES default from 5 to 2; expose as configurable maxAdaptiveRetries client option
  • Add enableOverloadRetargeting client option (default: false) to gate server deprioritization on overload errors
  • Inject "retry": N field into outgoing command bodies on retry attempts so the server can observe retry storm impact
  • Remove _retry_overload decorator from collection/database methods (retry now handled centrally in _ClientConnectionRetryable)

Test plan

  • Run existing backpressure spec tests: pytest test/test_client_backpressure.py
  • Verify maxRetries option is respected by the retry loop
  • Verify enableOverloadRetargeting=True restores deprioritization behavior

Generated with Claude Code

ShaneHarvey and others added 8 commits August 19, 2025 12:56
…ongodb#2497)

All commands that fail with the "Retryable" error label will be retried up to 3 times.
When the error includes the "SystemOverloaded" error label we apply exponential
backoff with jitter before attempting a retry.
Add adaptive token bucket based retry policy.
Successfully completed commands deposit 0.1 token.
Failed retry attempts consume 1 token.
A retry is only permitted if there is an available token.
Token bucket starts full with the maximum 1000 tokens.
…tion rate limiter triggers (mongodb#2509)

Co-authored-by: Iris <58442094+sleepyStick@users.noreply.github.com>
Co-authored-by: Noah Stapp <noah.stapp@mongodb.com>
Co-authored-by: Shane Harvey <shnhrv@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Resolve merge conflicts by taking upstream versions, which represent the
refined evolution of local prototype backpressure work.

Co-Authored-By: Claude Code <noreply@anthropic.com>
- Change MAX_RETRIES default from 5 to 2
- Add configurable maxAdaptiveRetries client option (default: 2)
- Add enableOverloadRetargeting client option (default: false)
- Add retry metadata ("retry": N) to outgoing command bodies on retry
- Remove _retry_overload decorator from collection/database methods

Co-Authored-By: Claude Code <noreply@anthropic.com>
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.

3 participants