Skip to content

[BUG] Keep the curl retry deadline stable within an attempt - #4452

Open
shixi-li wants to merge 2 commits into
open-telemetry:mainfrom
shixi-li:fix/stable-retry-deadline
Open

[BUG] Keep the curl retry deadline stable within an attempt#4452
shixi-li wants to merge 2 commits into
open-telemetry:mainfrom
shixi-li:fix/stable-retry-deadline

Conversation

@shixi-li

Copy link
Copy Markdown
Contributor

Fixes #4403

NextRetryTime() drew a new jitter sample on every call, so polling the same retryable request moved its deadline and biased the realized delay toward the lower end of the backoff band.

Changes

  • calculate and store one retry deadline when each curl attempt completes
  • make the stored deadline visible before the synchronous Response event and reuse it for scheduling
  • preserve valid Retry-After deadlines and use one stable jittered backoff when the header is missing or invalid
  • cover repeated reads, response-event visibility, invalid-header fallback, and later attempts

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed (no public API surface is changed)

Tests

  • focused curl retry deadline and exponential-backoff tests
  • full curl_http_test suite
  • ./ci/do_ci.sh cmake.maintainer.sync.test
  • ./ci/do_ci.sh cmake.test
  • ./ci/do_ci.sh cmake.exporter.otprotocol.test
  • ./ci/do_ci.sh format
  • markdownlint .

Coverage notes

The focused cases exercise the shared completion path through synchronous Send(). The existing full client suites cover async operation, but this change does not add an end-to-end timing assertion for the pending retry queue. Existing HTTP-date and over-max-backoff Retry-After behavior is unchanged. Local runtime validation was on Linux/amd64.

@shixi-li
shixi-li requested a review from a team as a code owner August 19, 2026 16:29
@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.36364% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.85%. Comparing base (3603e13) to head (b699ff2).

Files with missing lines Patch % Lines
ext/src/http/client/curl/http_operation_curl.cc 86.37% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4452      +/-   ##
==========================================
+ Coverage   82.63%   82.85%   +0.23%     
==========================================
  Files         512      512              
  Lines       20138    20145       +7     
==========================================
+ Hits        16639    16690      +51     
+ Misses       3499     3455      -44     
Files with missing lines Coverage Δ
...lemetry/ext/http/client/curl/http_operation_curl.h 91.31% <ø> (ø)
ext/src/http/client/curl/http_operation_curl.cc 62.99% <86.37%> (+2.40%) ⬆️

... and 1 file with indirect coverage changes

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

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.

[BUG] The curl retry deadline is redrawn on every call rather than decided once per attempt

2 participants