Deprecated method fetch_update used by Fluxer's Rust services, causing build warnings

(#3783) Bug Needs triage meta self-hosting

Observed behaviour

Fluxer's Rust services use rust:1-trixie, which currently floats to version 1.99. During builds of binaries for Fluxer's services, warnings appear indicating the use of method fetch_update is deprecated. This method has been superseded by try_update and officially deprecated in 1.99. Three services, in six locations, currently use fetch_update(): users, gifs, and media-proxy. Per the deprecation warning, these uses should be changed to try_update().

Reproduction steps

  1. Check out the repo at latest (currently commit ec681e6)
  2. Ensure presence of Rust 1.99 toolchain, per rust:1-trixie
  3. Build the users and gifs services with cargo build -p fluxer-users -p fluxer-gifs
  4. Observe deprecation warnings during build.
(media-proxy uses several libraries installed by script or included in Debian's packages. I've excluded it from above for simplicity but it can still be validated separately upon reviewing fluxer_media_proxy/src for the use of fetch_update)

Evidence

(example from fluxer_users)
warning: use of deprecated method `std::sync::atomic::Atomic::<u64>::fetch_update`: renamed to `try_update` for consistency
   --> fluxer_users/src/shard_impl.rs:390:14
    |
390 |             .fetch_update(Ordering::SeqCst, Ordering::SeqCst, |current| {
    |              ^^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default
help: replace the use of the deprecated method
    |
390 -             .fetch_update(Ordering::SeqCst, Ordering::SeqCst, |current| {
390 +             .try_update(Ordering::SeqCst, Ordering::SeqCst, |current| {
    |
(locating fetch_update use)
$ git grep -n 'fetch_update('
fluxer_gifs/src/shard_impl.rs:178:            .fetch_update(METRICS_ORDERING, METRICS_ORDERING, |generation| {
fluxer_media_proxy/src/byte_budget.rs:46:            .fetch_update(Ordering::AcqRel, Ordering::Acquire, |used| {
fluxer_media_proxy/src/server/middleware.rs:66:            .fetch_update(Ordering::AcqRel, Ordering::Acquire, |active| {
fluxer_media_proxy/src/server/native_task_executor.rs:218:            .fetch_update(Ordering::AcqRel, Ordering::Acquire, |active| {
fluxer_media_proxy/src/storage/source_read.rs:83:                .fetch_update(Ordering::AcqRel, Ordering::Acquire, |active| {
fluxer_users/src/shard_impl.rs:390:            .fetch_update(Ordering::SeqCst, Ordering::SeqCst, |current| {

1 comment

Sign in with Fluxer to comment and vote.
Comment by Qsie
Qsie OP1 vote
Working on a pull request from Qsie/fluxer-contrib to fix this, if I'm permitted.