Repository navigation
[BUG] Keep the curl retry deadline stable within an attempt - #4452
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4452 +/- ##
==========================================
+ Coverage 86.69% 86.80% +0.12%
==========================================
Files 525 525
Lines 20596 20603 +7
==========================================
+ Hits 17854 17883 +29
+ Misses 2742 2720 -22
🚀 New features to boost your workflow:
|
|
the defect is real. one correction to the description. "biased toward the lower end" is not the mechanism, and at the first attempt with defaults it is not the direction either. simulating the release rule at the default 256ms
at 1s the mean goes up, because poll quantisation dominates when the backoff is only four polls wide. the low bias appears once the backoff grows past that, and sharpens as the poll interval shrinks relative to it. the band narrowing is the part worth citing. the rename is contained, |
There was a problem hiding this comment.
reviewed the retry path against main. the deadline caching looks right and the tests cover what the issue described.
the one inline note is about the NextRetryTime() fallback. the reason I am raising it rather than letting it go is a second change this PR makes that the description does not mention.
IsRetryable() moves from after the DispatchEvent sequence to before it. previously the value computed inside PerformCurlMessage and the one the scheduler computes at http_client_curl.cc:539 sat on the same side of the
event handlers. now three synchronous dispatches run between them. i cannot find anything in tree that breaks the agreement between those two calls, so this is not a bug report. it is that the invariant the fallback quietly relies on is
weaker after this change than before it, which is why i would rather the fallback were a deliberate choice than a leftover.
one question on coverage: with ENABLE_OTLP_RETRY_PREVIEW off, IsRetryable() returns false unconditionally and the whole reordered block is a no op. are the new tests running under a job that defines it, or only locally?
| return next_retry_time_point_; | ||
| } | ||
|
|
||
| return CalculateNextRetryTime(); |
There was a problem hiding this comment.
this fallback is the behaviour #4403 describes, recomputing a fresh jittered value on every call.
i think it is unreachable as written. http_client_curl.cc:870 is the only non test caller and it only walks pending_to_retry_sessions_, which is filled at http_client_curl.cc:539 behind operation->IsRetryable(). whenever is_retryable is true this PR always stores a deadline, either the parsed
Retry-After or CalculateNextRetryTime() at line 1606. so nothing reaches the fallback and the old behaviour survives in a branch nothing exercises.
would you rather drop it so a missing deadline surfaces as a visible bug, or keep it with an assert naming the invariant? see the summary for why the invariant is worth naming.
Please note that this flag is about to be removed, see #3967 |
Checked against main at 489cd82: open-telemetry#4403 closed 2026-10-02 by open-telemetry#4452. NextRetryTime() returns a stored next_retry_time_point_ and only computes when it is unset, so the retry time is no longer redrawn on every read. open-telemetry#4425 closed 2026-09-10 by open-telemetry#4453. ReadError, WriteError and Destroyed are in the terminal group in otlp_http_client.cc rather than in default. open-telemetry#4396 closed 2026-09-24 by open-telemetry#4431. CURLOPT_PRIVATE still names the session, so that half of the bullet stands; what closed was a session holding more than one operation. The criteria table claimed four open reports against Shutdown and the document never named which four. It now names the two that are open and are about a shutdown deadline reaching the transport. Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
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
Responseevent and reuse it for schedulingRetry-Afterdeadlines and use one stable jittered backoff when the header is missing or invalidFor significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changesTests
curl_http_testsuite./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 formatmarkdownlint .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-backoffRetry-Afterbehavior is unchanged. Local runtime validation was on Linux/amd64.