Skip to content

Run the initial request with a nonpositive retry timeout - #2199

Merged
micafer merged 3 commits into
apache:trunkfrom
zhechen-cs:codex/retry-zero-timeout
Nov 10, 2026
Merged

micafer merged 3 commits into
apache:trunkfrom
zhechen-cs:codex/retry-zero-timeout

Conversation

@zhechen-cs

Copy link
Copy Markdown
Contributor

Description

Always run the initial request in MinimalRetry and Retry, including when the timeout is zero or negative. Previously these values skipped the request and raised an unrelated TypeError from raise None.

If the request fails after the deadline, propagate its exception without sleeping. Regression tests cover both retry classes, successful results, retryable connection and rate-limit errors, and non-retryable errors.

Fixes #2198

Status

Ready for review.

Validation

  • Common, connection, utility and HTTP tests: 213 passed, 1 skipped, 16 subtests passed (Python 3.12; NO_INTERNET=1, loopback proxy bypass).
  • New regressions fail on the unmodified production code.
  • Black, isort, flake8, pylint and git diff --check pass for the changed files.
  • The full provider matrix and live cloud integration tests were not run.

Checklist

  • Code linting
  • Documentation (no public API change)
  • Tests
  • ICLA (small bug fix)

@codecov-commenter

codecov-commenter commented Nov 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.63%. Comparing base (5ec65f1) to head (d3d6163).
⚠️ Report is 49 commits behind head on trunk.

Additional details and impacted files
@@            Coverage Diff             @@
##            trunk    #2199      +/-   ##
==========================================
+ Coverage   83.58%   83.63%   +0.05%     
==========================================
  Files         352      352              
  Lines       82117    82276     +159     
  Branches     8808     8859      +51     
==========================================
+ Hits        68634    68810     +176     
+ Misses      10608    10593      -15     
+ Partials     2875     2873       -2     
Files with missing lines Coverage Δ
libcloud/test/test_connection.py 96.91% <100.00%> (+0.25%) ⬆️
libcloud/utils/retry.py 85.39% <100.00%> (+0.34%) ⬆️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@micafer

micafer commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

please add the changelog entry.

@micafer micafer added the bug fix label Nov 6, 2026
@micafer micafer mentioned this pull request Nov 10, 2026
4 of 7 tasks
@micafer
micafer requested a review from tisonkun November 10, 2026 07:45
@tisonkun

Copy link
Copy Markdown
Member

@micafer The changelog entry has been added, along with regression tests for requests that fail exactly at or after a positive retry timeout. The tests use a controlled clock and verify that the original exception is propagated without sleeping or making another request.

The targeted tests pass (72 passed, 1 skipped, 24 subtests passed), as do Black, isort, flake8, pylint, the changelog RST check, and git diff --check. The changes are in d3d6163.

This PR should be ready for another review. Could you take another look?

@micafer
micafer enabled auto-merge November 10, 2026 08:23
@micafer
micafer merged commit 450590e into apache:trunk Nov 10, 2026
17 checks passed
@zhechen-cs
zhechen-cs deleted the codex/retry-zero-timeout branch November 10, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retry with a nonpositive timeout skips the initial request

4 participants