Skip to content

docs: describe what RetryHandlerOption.delay and max_delay actually do - #729

Merged
Vincent Biret (baywet) merged 4 commits into
microsoft:mainfrom
HardMax71:docs/retry-handler-option-delay
Sep 10, 2026
Merged

Vincent Biret (baywet) merged 4 commits into
microsoft:mainfrom
HardMax71:docs/retry-handler-option-delay

Conversation

@HardMax71

Copy link
Copy Markdown
Contributor

Overview

Docstrings only, no behaviour change. RetryHandlerOption now says what its constructor takes: delay is a base delay added to every computed backoff, exposed as max_delay, and not a cap; max_retries is exposed as max_retry. The comment on MAX_DELAY says it is the largest accepted value and the point at which the handler stops retrying. The RetryHandler class docstring, which documented four parameters the constructor does not take, now describes the actual policy: status codes, methods, the option fields, and how the delay is computed. get_delay_time says that a Retry-After header is returned as is and that the backoff path is capped at backoff_max.

Related Issue

Fixes #728

Notes

respect_retry_after_header (retry_handler.py:66) is still assigned and never read; left alone here since this PR is docs only. Renaming max_delay would break a public property, so the name stays and the docstrings explain it.

Testing Instructions

  • cd packages/http/httpx && pytest tests/middleware_tests/test_retry_handler.py: unchanged, passes.
  • yapf, isort, mypy and pylint clean on the two files.

The option stores delay as max_delay and the handler adds it to every
backoff; the caps are backoff_max and MAX_DELAY. The RetryHandler class
docstring listed four constructor parameters that do not exist.
@HardMax71
Max Azatian (HardMax71) requested a review from a team as a code owner September 10, 2026 18:34
Copilot AI lite review requested due to automatic review settings September 10, 2026 18:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@baywet Vincent Biret (baywet) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@github-project-automation github-project-automation Bot moved this to In Progress 🚧 in Kiota Sep 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The updated documentation introduces/retains a few inaccuracies versus the current implementation (notably Retry-After: 0 handling and some wording around MAX_DELAY) that should be corrected before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread packages/http/httpx/kiota_http/middleware/retry_handler.py Outdated
Comment thread packages/http/httpx/kiota_http/middleware/options/retry_handler_option.py Outdated
Comment thread packages/http/httpx/kiota_http/middleware/retry_handler.py Outdated
auto-merge was automatically disabled September 10, 2026 18:44

Head branch was pushed to by a user without write access

@baywet Vincent Biret (baywet) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making the changes!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

One updated docstring still inaccurately describes the backoff cap as a fixed constant rather than the configurable backoff_max actually used by the implementation.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread packages/http/httpx/kiota_http/middleware/retry_handler.py Outdated
auto-merge was automatically disabled September 10, 2026 18:49

Head branch was pushed to by a user without write access

@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are documentation-only and the updated docstrings match the current implementation behavior (retry conditions and delay computation).

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@baywet
Vincent Biret (baywet) merged commit 1b1e52d into microsoft:main Sep 10, 2026
53 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress 🚧 to Done ✔️ in Kiota Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done ✔️

Development

Successfully merging this pull request may close these issues.

RetryHandlerOption.max_delay is the base delay, not a maximum, and the RetryHandler docstring documents parameters that do not exist

3 participants