Skip to content

fix(send_with_retry): follow max retries of the strategy#2047

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
vianney/fix-send-with-retry
Jun 1, 2026
Merged

fix(send_with_retry): follow max retries of the strategy#2047
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
vianney/fix-send-with-retry

Conversation

@VianneyRuhlmann

Copy link
Copy Markdown
Contributor

What does this PR do?

Fix an off-by 1 error in send_with_retry in the number of retries. The max_retries field of the RetryStrategy was effectively used as max_attempts.

The default strategy has not been modified and will no do up to 5 retries so 6 attempts (previously 5 attempts). However the OTLP code indicates that the intent was to have 5 total attempts so the strategy has ben updated to keep the same total of attempts.

Motivation

There's an off by 1 error in the send_with_retry count of retries.

Additional Notes

Anything else we should know when reviewing?

How to test the change?

Describe here in detail how the change can be validated.

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 84.21%
Overall Coverage: 72.86% (-0.04%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 13a1614 | Docs | Datadog PR Page | Give us feedback!

@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Clippy Allow Annotation Report

Comparing clippy allow annotations between branches:

  • Base Branch: origin/main
  • PR Branch: origin/vianney/fix-send-with-retry

Summary by Rule

Rule Base Branch PR Branch Change
unwrap_used 8 8 No change (0%)
Total 8 8 No change (0%)

Annotation Counts by File

File Base Branch PR Branch Change
libdd-data-pipeline/src/trace_exporter/mod.rs 2 2 No change (0%)
libdd-trace-stats/src/stats_exporter.rs 1 1 No change (0%)
libdd-trace-utils/src/send_data/mod.rs 5 5 No change (0%)

Annotation Stats by Crate

Crate Base Branch PR Branch Change
clippy-annotation-reporter 5 5 No change (0%)
datadog-ffe-ffi 1 1 No change (0%)
datadog-ipc 21 21 No change (0%)
datadog-live-debugger 6 6 No change (0%)
datadog-live-debugger-ffi 10 10 No change (0%)
datadog-profiling-replayer 4 4 No change (0%)
datadog-remote-config 3 3 No change (0%)
datadog-sidecar 57 57 No change (0%)
libdd-common 13 13 No change (0%)
libdd-common-ffi 12 12 No change (0%)
libdd-data-pipeline 5 5 No change (0%)
libdd-ddsketch 2 2 No change (0%)
libdd-dogstatsd-client 1 1 No change (0%)
libdd-profiling 13 13 No change (0%)
libdd-telemetry 20 20 No change (0%)
libdd-tinybytes 4 4 No change (0%)
libdd-trace-normalization 2 2 No change (0%)
libdd-trace-obfuscation 3 3 No change (0%)
libdd-trace-stats 1 1 No change (0%)
libdd-trace-utils 13 13 No change (0%)
Total 196 196 No change (0%)

About This Report

This report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality.

@VianneyRuhlmann VianneyRuhlmann force-pushed the vianney/fix-send-with-retry branch from 1c1e007 to b71cfaf Compare May 27, 2026 12:23
@VianneyRuhlmann VianneyRuhlmann marked this pull request as ready for review May 27, 2026 12:33
@VianneyRuhlmann VianneyRuhlmann requested review from a team as code owners May 27, 2026 12:33
@VianneyRuhlmann VianneyRuhlmann requested review from mabdinur and removed request for a team May 27, 2026 12:33

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b71cfaf68a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread libdd-trace-utils/src/send_with_retry/mod.rs
@VianneyRuhlmann VianneyRuhlmann force-pushed the vianney/fix-send-with-retry branch from 81b23f4 to 4da486c Compare May 28, 2026 09:43
@VianneyRuhlmann VianneyRuhlmann requested a review from a team as a code owner May 28, 2026 09:43
@codecov-commenter

codecov-commenter commented May 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.86%. Comparing base (f7d471d) to head (13a1614).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2047      +/-   ##
==========================================
- Coverage   72.90%   72.86%   -0.05%     
==========================================
  Files         460      460              
  Lines       76396    76394       -2     
==========================================
- Hits        55696    55662      -34     
- Misses      20700    20732      +32     
Components Coverage Δ
libdd-crashtracker 65.20% <ø> (-0.03%) ⬇️
libdd-crashtracker-ffi 36.82% <ø> (ø)
libdd-alloc 98.77% <ø> (ø)
libdd-data-pipeline 85.60% <ø> (ø)
libdd-data-pipeline-ffi 75.70% <ø> (ø)
libdd-common 79.89% <ø> (ø)
libdd-common-ffi 74.41% <ø> (ø)
libdd-telemetry 73.34% <ø> (ø)
libdd-telemetry-ffi 31.36% <ø> (ø)
libdd-dogstatsd-client 82.64% <ø> (ø)
datadog-ipc 74.75% <ø> (-1.47%) ⬇️
libdd-profiling 81.69% <ø> (ø)
libdd-profiling-ffi 64.79% <ø> (ø)
libdd-sampling 97.46% <ø> (ø)
datadog-sidecar 29.19% <ø> (ø)
datdog-sidecar-ffi 10.17% <ø> (ø)
spawn-worker 48.86% <ø> (ø)
libdd-tinybytes 93.80% <ø> (ø)
libdd-trace-normalization 81.71% <ø> (ø)
libdd-trace-obfuscation 87.30% <ø> (ø)
libdd-trace-protobuf 68.25% <ø> (ø)
libdd-trace-utils 88.94% <83.33%> (-0.01%) ⬇️
libdd-tracer-flare 86.88% <ø> (ø)
libdd-log 74.83% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dd-octo-sts

dd-octo-sts Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 7.63 MB 7.63 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 82.94 MB 82.94 MB -0% (-200 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 94.02 MB 94.02 MB -0% (-80 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.25 MB 10.25 MB 0% (0 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 24.54 MB 24.54 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 83.96 KB 83.96 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 178.23 MB 178.25 MB +0% (+16.00 KB) 👌
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 915.25 MB 915.25 MB +0% (+188 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 8.03 MB 8.03 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 83.96 KB 83.96 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 23.77 MB 23.77 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 47.43 MB 47.43 MB +0% (+26 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 21.27 MB 21.27 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 85.29 KB 85.29 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 182.23 MB 182.23 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 908.37 MB 908.37 MB +0% (+180 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 6.20 MB 6.20 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 85.29 KB 85.29 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 25.48 MB 25.48 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 45.07 MB 45.07 MB +0% (+4 B) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 73.95 MB 73.95 MB +0% (+32 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.52 MB 8.52 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 89.36 MB 89.36 MB +0% (+16 B) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.36 MB 10.36 MB 0% (0 B) 👌

Comment thread libdd-data-pipeline/src/otlp/exporter.rs
iunanua added a commit that referenced this pull request Jun 5, 2026
# Release proposal for libdd-sampling and its dependencies

This PR contains version bumps based on public API changes and commits
since last release.

## libdd-trace-utils
**Next version:** `7.0.0`
**Semver bump:** `major`
**Tag:** `libdd-trace-utils-v7.0.0`

### Commits

- feat(trace-utils)!: add dedup convenience to VecMap (#2049)
- fix(trace-utils): match the Go trace agent when parsing
`datadog-client-computed-*` bool headers (#2071)
- revert!: add from_string to span text (#2011) (#2073)
- fix(send_with_retry): follow max retries of the strategy (#2047)

## libdd-sampling (manually bumped due to breaking in #2073)
**Next version:** ~~`2.1.1`~~ `3.0.0`
**Semver bump:** ~~`patch`~~ `major`
**Tag:** ~~`libdd-sampling-v2.1.1`~~ `libdd-sampling-v3.0.0`

### Commits

- fix(sampling): format _dd.p.ksr to 6 decimal places, not 6 significant
digits (#2086)
- revert!: add from_string to span text (#2011) (#2073)

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: iunanua <18325288+iunanua@users.noreply.github.com>
Co-authored-by: iunanua <igor.unanua@datadoghq.com>
iunanua added a commit that referenced this pull request Jun 8, 2026
# Release proposal for libdd-data-pipeline and its dependencies

This PR contains version bumps based on public API changes and commits
since last release.

## libdd-trace-utils
**Next version:** `8.0.0`
**Semver bump:** `major`
**Tag:** `libdd-trace-utils-v8.0.0`

### Commits

- refactor(vecmap)!: avoid Clone bound from dedup (#2069)

## libdd-telemetry
**Next version:** `5.0.1`
**Semver bump:** `patch`
**Tag:** `libdd-telemetry-v5.0.1`

### Commits

- fix(libdd-telemetry): serialize Method::Other as "*" per OpenAPI spec
(#1998)

## libdd-trace-obfuscation
**Next version:** `4.0.0`
**Semver bump:** `major`
**Tag:** `libdd-trace-obfuscation-v4.0.0`

### ⚠️ major bump forced due to:

- `libdd-trace-utils`: ^5.0.0 → ^7.0.0

### Commits

- ci: bump msrv to 1.87.0 (#2017)

## libdd-trace-stats
**Next version:** `5.0.0`
**Semver bump:** `major`
**Tag:** `libdd-trace-stats-v5.0.0`

### ⚠️ major bump forced due to:

- `libdd-trace-utils`: ^5.0.0 → ^7.0.0

### Commits

- revert!: add from_string to span text (#2011) (#2073)
- fix(send_with_retry): follow max retries of the strategy (#2047)
- ci: bump msrv to 1.87.0 (#2017)

## libdd-data-pipeline
**Next version:** `6.0.0`
**Semver bump:** `major`
**Tag:** `libdd-data-pipeline-v6.0.0`

### ⚠️ major bump forced due to:

- `libdd-trace-utils`: ^5.0.0 → ^7.0.0

### Commits

- feat(data-pipeline)!: add fork safety hooks and cancellation token for
trace exporter FFI (#2051)
- revert!: add from_string to span text (#2011) (#2073)
- feat(data-pipeline): move the async boundary up (#2064)
- feat(trace-exporter): add fail-closed fallback to v04 (#2037)
- fix(send_with_retry): follow max retries of the strategy (#2047)
- refactor(trace-utils): replace use_v05_format bool and remove
infallible expect (#1946)
- ci: bump msrv to 1.87.0 (#2017)

## libdd-sampling (manually bumped as it wasn't included in the
proposal)
**Next version:** `4.0.0`
**Semver bump:** `major`
**Tag:** `libdd-sampling-v4.0.0`

### ⚠️ major bump forced due to:

- `libdd-trace-utils`: ^7.0.0 → ^8.0.0

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: iunanua <18325288+iunanua@users.noreply.github.com>
Co-authored-by: iunanua <igor.unanua@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants