Skip to content

fix(docs): replace deprecated atomic fetch_update with try_update - #2007

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 5 commits into
mainfrom
jszwedko/fix-deprecated-atomic-methods
Jul 6, 2026
Merged

fix(docs): replace deprecated atomic fetch_update with try_update#2007
gh-worker-dd-mergequeue-cf854d[bot] merged 5 commits into
mainfrom
jszwedko/fix-deprecated-atomic-methods

Conversation

@jszwedko

@jszwedko jszwedko commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Newer Rust nightly toolchains renamed Atomic*::fetch_update to try_update for consistency. Because make generate-api-docs runs cargo +nightly doc and all affected crates have #![deny(warnings)], the deprecation is promoted to a hard error, breaking the CI generate-api-docs job.

This replaces all three fetch_update call sites with try_update. The new name is available on both the nightly used by make generate-api-docs and the pinned stable 1.96.0 toolchain used for regular builds, checks, and tests.

Test plan

  • make generate-api-docs passes on the updated nightly (1.99.0-nightly 2026-07-05).
  • cargo +1.96.0 check --tests passes for the affected crates.

🤖 Generated with Claude Code

Newer Rust toolchains renamed `Atomic*::fetch_update` to `try_update`.
Under `#![deny(warnings)]`, the deprecation warning breaks the nightly
`make generate-api-docs` build.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@dd-octo-sts dd-octo-sts Bot added area/io General I/O and networking. area/memory Memory bounds and memory management. area/observability Internal observability of ADP and Saluki. labels Jul 6, 2026
@jszwedko
jszwedko marked this pull request as ready for review July 6, 2026 14:54
@jszwedko
jszwedko requested a review from a team as a code owner July 6, 2026 14:54
@jszwedko jszwedko changed the title fix(build): replace deprecated atomic fetch_update with try_update fix(ci): replace deprecated atomic fetch_update with try_update Jul 6, 2026
@jszwedko jszwedko changed the title fix(ci): replace deprecated atomic fetch_update with try_update fix(docs): replace deprecated atomic fetch_update with try_update Jul 6, 2026

@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: ca26b84efc

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/stringtheory/src/interning/fixed_size.rs
loom 0.7 does not have `try_update` on its `AtomicUsize`; only std does
(it was renamed from `fetch_update`). Use cfg(feature = "loom") to call
`fetch_update` under loom and `try_update` otherwise.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@pr-commenter

pr-commenter Bot commented Jul 6, 2026

Copy link
Copy Markdown

Binary Size Analysis (Agent Data Plane)

Baseline: 92cb9bd · Comparison: 69898d0 · diff
Analysis Configuration: stripped binaries · Pass/Fail Threshold: +5%
Sizes: 41.68 MiB (baseline) vs 41.68 MiB (comparison)
Size Change: -1.84 KiB (-0.00%)

✅ Binary size difference within threshold

Changes by Module
Module File Size Symbols
anon.cf56bb6471aa9270e7a728118d029e6e.947.llvm.12607680965653781912 -8.22 KiB 1
anon.98a37a06ff68d3d0f2393321fd4fbb84.42.llvm.14954184574103334871 +8.22 KiB 1
anon.cf56bb6471aa9270e7a728118d029e6e.268.llvm.12607680965653781912 -1.58 KiB 1
anon.643ca8cd3b9ca8caf8050c0c2446f868.6.llvm.16129501826117413111 +1.58 KiB 1
anon.168fdbdcbd293237ddac692d5d37499c.1219.llvm.13116985673205370977 -1.33 KiB 1
anon.f82bc269051681e8a724b8fdc087cefb.462.llvm.10630671376149894769 +1.33 KiB 1
anon.9280f95497913dff063eb674089c68f5.206.llvm.18351948480930146335 -1.31 KiB 1
anon.90f8a0abd2a563f68c734d269c584ea9.6.llvm.11899418360988404436 +1.31 KiB 1
anon.cf56bb6471aa9270e7a728118d029e6e.989.llvm.12607680965653781912 -991 B 1
anon.cf56bb6471aa9270e7a728118d029e6e.989.llvm.4807352847396306277 +990 B 1
_RNvMs5_NtNtCsebJFismJkYh_3std2io5errorNtB5_5Error4kind.llvm.10630671376149894769 +971 B 1
_RNvMs5_NtNtCsebJFismJkYh_3std2io5errorNtB5_5Error4kind.llvm.13116985673205370977 -971 B 1
_RNvMs5_NtNtCsebJFismJkYh_3std2io5errorNtB5_5Error4kind.llvm.7829369532591319245 +970 B 1
_RNvMs5_NtNtCsebJFismJkYh_3std2io5errorNtB5_5Error4kind.llvm.5393151997502852220 -970 B 1
anon.cf56bb6471aa9270e7a728118d029e6e.1132.llvm.12607680965653781912 -959 B 1
anon.2548c38f18f37034baa7db12de64290d.216.llvm.13174923671247490954 +957 B 1
anon.f82bc269051681e8a724b8fdc087cefb.0.llvm.5393151997502852220 -817 B 1
anon.168fdbdcbd293237ddac692d5d37499c.3.llvm.7829369532591319245 +815 B 1
anon.9280f95497913dff063eb674089c68f5.1088.llvm.18351948480930146335 -734 B 1
anon.9280f95497913dff063eb674089c68f5.1088.llvm.1987535660319435197 +733 B 1
Detailed Symbol Changes
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [NEW] +8.22Ki  [NEW]     +91    anon.98a37a06ff68d3d0f2393321fd4fbb84.42.llvm.14954184574103334871
  [NEW] +1.58Ki  [NEW]     +86    anon.643ca8cd3b9ca8caf8050c0c2446f868.6.llvm.16129501826117413111
   +87% +1.34Ki  +220%    +584    core::ptr::drop_in_place<axum::routing::Endpoint<saluki_components::destinations::dsd_stats::DogStatsDStatsAPIHandlerState>>::h3145115554f80f48
  [NEW] +1.33Ki  [NEW]     +91    anon.f82bc269051681e8a724b8fdc087cefb.462.llvm.10630671376149894769
  [NEW] +1.31Ki  [NEW]     +74    anon.90f8a0abd2a563f68c734d269c584ea9.6.llvm.11899418360988404436
  [NEW] +1.05Ki  [NEW]    +839    hashbrown::table::HashTable<T,A>::find::h97a67f2390ea7ffd
  [NEW]    +990  [NEW]     +84    anon.cf56bb6471aa9270e7a728118d029e6e.989.llvm.4807352847396306277
  [NEW]    +971  [NEW]    +865    _RNvMs5_NtNtCsebJFismJkYh_3std2io5errorNtB5_5Error4kind.llvm.10630671376149894769
  [NEW]    +970  [NEW]    +865    _RNvMs5_NtNtCsebJFismJkYh_3std2io5errorNtB5_5Error4kind.llvm.7829369532591319245
  [NEW]    +957  [NEW]     +42    anon.2548c38f18f37034baa7db12de64290d.216.llvm.13174923671247490954
  [DEL]    -959  [DEL]     -42    anon.cf56bb6471aa9270e7a728118d029e6e.1132.llvm.12607680965653781912
  [DEL]    -970  [DEL]    -865    _RNvMs5_NtNtCsebJFismJkYh_3std2io5errorNtB5_5Error4kind.llvm.5393151997502852220
  [DEL]    -971  [DEL]    -865    _RNvMs5_NtNtCsebJFismJkYh_3std2io5errorNtB5_5Error4kind.llvm.13116985673205370977
  [DEL]    -991  [DEL]     -84    anon.cf56bb6471aa9270e7a728118d029e6e.989.llvm.12607680965653781912
  [DEL] -1.10Ki  [DEL]    -887    hashbrown::table::HashTable<T,A>::find::h447f879998f01059
  [DEL] -1.31Ki  [DEL]     -74    anon.9280f95497913dff063eb674089c68f5.206.llvm.18351948480930146335
  [DEL] -1.33Ki  [DEL]     -91    anon.168fdbdcbd293237ddac692d5d37499c.1219.llvm.13116985673205370977
 -66.3% -1.35Ki -50.0%    -584    core::ptr::drop_in_place<axum::routing::Endpoint<$LP$$RP$>>::hf01547e73dfb869f
  [DEL] -1.58Ki  [DEL]     -86    anon.cf56bb6471aa9270e7a728118d029e6e.268.llvm.12607680965653781912
  -0.1% -1.77Ki  +0.0%     +48    [2956 Others]
  [DEL] -8.22Ki  [DEL]     -91    anon.cf56bb6471aa9270e7a728118d029e6e.947.llvm.12607680965653781912
  -0.0% -1.84Ki  [ = ]       0    TOTAL

@datadog-datadog-prod-us1-2

This comment has been minimized.

@pr-commenter

pr-commenter Bot commented Jul 6, 2026

Copy link
Copy Markdown

Regression Detector (Agent Data Plane)

Run ID: 7e5c94b6-4444-41cc-bd2e-051bf1fa4b73
Baseline: 92cb9bda · Comparison: 69898d0e · diff

Optimization Goals: ✅ No significant changes detected

Fine details of change detection per experiment (5)

Experiments configured erratic: true are tagged (ignored) and skipped when determining which experiments regressed or improved. Experiments which are detected as erratic at runtime are tagged (erratic) to flag that the run's sample dispersion was high, but their regression / improvement signal still counts.

experiment goal Δ mean % links
quality_gates_rss_dsd_low memory ⚪ +0.28 metrics profiles logs
quality_gates_rss_dsd_medium memory ⚪ +0.24 metrics profiles logs
quality_gates_rss_idle memory ⚪ +0.05 metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory ⚪ +0.04 metrics profiles logs
quality_gates_rss_dsd_heavy memory ⚪ -0.43 metrics profiles logs
Bounds Checks: ✅ Passed (5)
experiment check replicates observed links
quality_gates_rss_dsd_heavy memory_usage 10/10 ✅ 138 MiB ≤ 140 MiB metrics profiles logs
quality_gates_rss_dsd_low memory_usage 10/10 ✅ 43.2 MiB ≤ 50 MiB metrics profiles logs
quality_gates_rss_dsd_medium memory_usage 10/10 ✅ 65.3 MiB ≤ 75 MiB metrics profiles logs
quality_gates_rss_dsd_ultraheavy memory_usage 10/10 ✅ 191 MiB ≤ 200 MiB metrics profiles logs
quality_gates_rss_idle memory_usage 10/10 ✅ 29.1 MiB ≤ 40 MiB metrics profiles logs
Explanation

A change is flagged as a regression when |Δ mean %| > 5.00% in the regressing direction for its optimization goal AND SMP marks the experiment as a regression (is_regression: true). Improvements use the matching criteria for the improving direction. Experiments configured erratic: true (tagged (ignored)) are skipped outright; experiments detected as erratic at runtime (tagged (erratic)) still count, since that flag describes sample dispersion rather than directional certainty. The Δ mean % cell is colored accordingly: 🟢 = improvement, 🔴 = regression, ⚪ = neutral. Reduction in CPU or memory is an improvement; reduction in ingress throughput is a regression.

nightly-2025-06-16 predates the stabilization of `atomic_try_update`,
so `try_update` on `AtomicUsize` fails to compile under that toolchain.
Bumping to 2026-07-05 picks up the stabilization and unblocks Miri CI.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Introduce RUST_NIGHTLY_VERSION variable so generate-api-docs and test-miri
share a single pinned nightly version. Previously:
- generate-api-docs used bare +nightly (always latest)
- test-miri used +nightly-2026-07-05 (pinned)

This mismatch was confusing and easy to get out of sync.

New structure:
- RUST_NIGHTLY_VERSION := nightly-2026-07-05 defined once in Makefile
- Both targets reference $(RUST_NIGHTLY_VERSION)
- New `ensure-rust-nightly` target installs the pinned toolchain
- `ensure-rust-miri` now depends on ensure-rust-nightly + adds miri component
- `generate-api-docs` now depends on ensure-rust-nightly (auto-installs for
  local dev, mirroring how miri works)
- docs.yml workflow now installs stable (make handles nightly version),
  making the Makefile the single source of truth

To update the nightly version in the future, change RUST_NIGHTLY_VERSION
in one place and both targets + CI pick up the change automatically.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@dd-octo-sts dd-octo-sts Bot added the area/ci CI/CD, automated testing, etc. label Jul 6, 2026
Resolve conflict in .github/workflows/docs.yml: adopt main's updated
action pin (v1.17) while keeping our changes (comment, renamed step,
toolchain: stable).

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 917e05f into main Jul 6, 2026
82 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the jszwedko/fix-deprecated-atomic-methods branch July 6, 2026 18:05
jszwedko added a commit that referenced this pull request Jul 6, 2026
Related to #2007, adapted for the 1.1.0 toolchain.

Newer nightly toolchains deprecate Atomic*::fetch_update in favor of
try_update. Because make generate-api-docs runs cargo +nightly doc and the
affected crates have #![deny(warnings)], the deprecation is promoted to a hard
error, breaking the CI generate-api-docs job.

The main-branch fix (#2007) switched to try_update, but that method isn't
stable on the 1.93.0 toolchain pinned on this branch. Instead, suppress the
deprecation with #[allow(deprecated)] at the three call sites, keeping
fetch_update (stable here) while letting the nightly doc build pass.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This was referenced Jul 6, 2026
jszwedko added a commit that referenced this pull request Jul 7, 2026
Related to #2007, adapted for the 1.1.0 toolchain.

Newer nightly toolchains deprecate Atomic*::fetch_update in favor of
try_update. Because make generate-api-docs runs cargo +nightly doc and the
affected crates have #![deny(warnings)], the deprecation is promoted to a hard
error, breaking the CI generate-api-docs job.

The main-branch fix (#2007) switched to try_update, but that method isn't
stable on the 1.93.0 toolchain pinned on this branch. Instead, suppress the
deprecation with #[allow(deprecated)] at the three call sites, keeping
fetch_update (stable here) while letting the nightly doc build pass.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Jul 7, 2026
## Summary

Release-prep PR for **ADP 1.2.3** on `releases/1.2.x`. Bumps the version and bundles four fixes. Because 1.2.x is on Rust 1.96.0 (same as `main`), the `fetch_update` fix could be cherry-picked directly rather than needing the `#[allow(deprecated)]` workaround used on 1.1.0.

1. **Honor `site` when `dd_url` equals the default-derived URL** — corresponds to #2028 (`7ec65f2`). The Core Agent's config stream sends `dd_url` at its schema default (`https://app.datadoghq.com`) for every configuration, even when the operator only set `site`, so ADP routed all traffic to the US1 intake and `site` was effectively ignored (#1965). A `dd_url` equal to the default-derived URL is now filtered to `None` at deserialization, letting `site` determine the endpoint. `set_dd_url` bypasses serde and is unaffected. Adapted to the 1.2.x code (no `configured_primary_endpoint`), so the change is confined to the `dd_url` deserializer plus tests.

2. **Unblock the nightly `generate-api-docs` build** — cherry-pick of #2007 (`917e05f`). Newer nightly toolchains deprecate `Atomic*::fetch_update`; under `#![deny(warnings)]`, `cargo +nightly doc` turns that into a hard error. Since 1.2.x uses the 1.96.0 toolchain (where `try_update` is stable), the three call sites switch to `try_update`, matching `main`. (The `fixed_size.rs` hunk from the original commit was dropped — that method doesn't exist on 1.2.x and has no `fetch_update` to fix.)

3. **Update `anyhow`** — cherry-pick of #1945 (`bc51393`). Bumps `anyhow` 1.0.102 → 1.0.103 in `Cargo.lock` to unblock `check deny`. (The `2a7be76` hash is the gh-pages docs artifact for that PR; `bc51393` is the source commit.)

4. **Bump `crossbeam-epoch` to 0.9.20** — fresh fix for RUSTSEC-2026-0204. `crossbeam-epoch 0.9.18` (an invalid pointer dereference in the `fmt::Pointer` impl for `Atomic`/`Shared`) fails `check-deny`. This is a repo-wide issue; the equivalent fix for `main` is #2038. Applied directly here (semver-compatible, lockfile-only bump) rather than cherry-picked, since it landed on the release branches in parallel with the main PR.

Plus a `chore(dev): Bump ADP to 1.2.3` commit updating `bin/agent-data-plane/Cargo.toml` and the lockfile.

## Test plan

- New unit tests for the `dd_url`/`site` resolution (default filtered → `None`; explicit override wins; `set_dd_url` never filtered; end-to-end `build_primary_endpoint` for both cases).
- `make check-deny` passes with the crossbeam-epoch bump.
- `cargo check` passes for the affected crates on the pinned `1.96.0` toolchain, including the `try_update` call sites.

Fixes #1965.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: webern <matt.briggs@datadoghq.com>
Co-authored-by: jesse.szwedko <jesse.szwedko@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci CI/CD, automated testing, etc. area/io General I/O and networking. area/memory Memory bounds and memory management. area/observability Internal observability of ADP and Saluki. mergequeue-status: done

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants