Repository navigation
fix: avoid deprecated Atomic::fetch_update on rustc 1.99 - #316
Conversation
The permit acquisition path now uses an explicit compare_exchange_weak loop instead of fetch_update, since fetch_update is deprecated in favour of try_update on newer toolchains but try_update is not stable on this crate's MSRV. A test covers concurrent acquires to confirm the pool never grants more permits than its size. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Annotate the two `fetch_update` call sites with `#[allow(deprecated)]` and bind the result to a local, since the replacement `try_update` is not stable on this crate's MSRV. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Tiny Sweeper reviewReviewed head: Verdict: Ready for maintainer review · Priority: none Diagnostics and supporting detailsFull summaryPull request purpose (title): fix: avoid deprecated Atomic::fetch_update on rustc 1.99. This pull request, titled "fix: avoid deprecated Atomic::fetch_update on rustc 1.99," replaces uses of `Atomic::fetch_update` — deprecated on Rust 1.99 in favor of `try_update`, which is not stable on the crate's MSRV 1.96 — with behavior-equivalent alternatives across the prefetch worker pool and two test helpers, and adds a concurrency test for the worker pool. No trusted push-delta comparison is available, so no push-delta analysis is reported. Review snapshot
Completeness: Complete What changed`WorkerPool::try_acquire` in crates/tinymemory-tools/src/prefetch/mod.rs now uses a `compare_exchange_weak` loop instead of `fetch_update`, loading `free` with `Acquire`, returning `None` when `checked_sub(1)` fails (pool exhausted), and retrying with the observed value on contention; a grant returns a `Permit` whose `Drop` releases the unit. Two test helpers — the `take_one` decrement helper in crates/tinymemory-integrations/src/cortex/testing/mod.rs and the flaky `ListStore` save counter in crates/tinymemory-tools/src/deletion/mod_tests.rs — keep `fetch_update` but gain `#[allow(deprecated)]` with an MSRV comment. A new test, `concurrent_acquires_never_exceed_the_pool_size`, spawns 16 scoped threads against a pool of 3 and asserts exactly 3 permits are granted and availability returns to 3 after release. Features
TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. FindingsNo active actionable findings. Before mergeNone. Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Rust 1.99 deprecates
Atomic::fetch_update(renamedtry_update, not stable on MSRV 1.96).WorkerPool::try_acquire: compare_exchange loop with identical semantics; new testconcurrent_acquires_never_exceed_the_pool_size.#[allow(deprecated)]with MSRV comment.Verified: clippy
-D warningson 1.96.1 and 1.99.1, fmt, doc, nextest 1781/1781.Summary by CodeRabbit