Skip to content

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

Open
zhechen-cs wants to merge 2 commits into
apache:trunkfrom
zhechen-cs:codex/retry-zero-timeout
Open

zhechen-cs wants to merge 2 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

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.59%. Comparing base (5ec65f1) to head (369ef80).

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk    #2199   +/-   ##
=======================================
  Coverage   83.58%   83.59%           
=======================================
  Files         352      352           
  Lines       82117    82139   +22     
  Branches     8808     8818   +10     
=======================================
+ Hits        68634    68656   +22     
  Misses      10608    10608           
  Partials     2875     2875           
Files with missing lines Coverage Δ
libcloud/test/test_connection.py 96.79% <100.00%> (+0.13%) ⬆️
libcloud/utils/retry.py 85.39% <100.00%> (+0.34%) ⬆️
🚀 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
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

3 participants