Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jul 2, 2025

Bumps tokio from 1.45.1 to 1.46.0.

Release notes

Sourced from tokio's releases.

Tokio v1.46.0

1.46.0 (July 2nd, 2025)

Fixed

  • net: fixed TcpStream::shutdown incorrectly returning an error on macOS (#7290)

Added

  • sync: mpsc::OwnedPermit::{same_channel, same_channel_as_sender} methods (#7389)
  • macros: biased option for join! and try_join!, similar to select! (#7307)
  • net: support for cygwin (#7393)
  • net: support pope::OpenOptions::read_write on Android (#7426)
  • net: add Clone implementation for net::unix::SocketAddr (#7422)

Changed

  • runtime: eliminate unnecessary lfence while operating on queue::Local<T> (#7340)
  • task: disallow blocking in LocalSet::{poll,drop} (#7372)

Unstable

  • runtime: add TaskMeta::spawn_location tracking where a task was spawned (#7417)
  • runtime: removed borrow from LocalOptions parameter to runtime::Builder::build_local (#7346)

Documented

  • io: clarify behavior of seeking when start_seek is not used (#7366)
  • io: document cancellation safety of AsyncWriteExt::flush (#7364)
  • net: fix docs for recv_buffer_size method (#7336)
  • net: fix broken link of RawFd in TcpSocket docs (#7416)
  • net: update AsRawFd doc link to current Rust stdlib location (#7429)
  • readme: fix double period in reactor description (#7363)
  • runtime: add doc note that on_*_task_poll is unstable (#7311)
  • sync: update broadcast docs on allocation failure (#7352)
  • time: add a missing panic scenario of time::advance (#7394)

#7290: tokio-rs/tokio#7290 #7307: tokio-rs/tokio#7307 #7311: tokio-rs/tokio#7311 #7336: tokio-rs/tokio#7336 #7340: tokio-rs/tokio#7340 #7346: tokio-rs/tokio#7346 #7352: tokio-rs/tokio#7352 #7363: tokio-rs/tokio#7363 #7364: tokio-rs/tokio#7364 #7366: tokio-rs/tokio#7366 #7372: tokio-rs/tokio#7372 #7389: tokio-rs/tokio#7389 #7393: tokio-rs/tokio#7393

... (truncated)

Commits
  • 3f1f268 chore: prepare Tokio v1.46.0 (#7437)
  • 3e890cc rt(unstable): add spawn Location to TaskMeta (#7417)
  • 69290a6 net: derive Clone for net::unix::SocketAddr (#7422)
  • e2b1758 fuzz: cfg fuzz tests under cfg(test) (#7428)
  • b7a75b5 net: update AsRawFd doc link to current Rust stdlib location (#7429)
  • 6b705b3 net: allow pipe::OpenOptions::read_write on Android (#7426)
  • 3636fd0 net: fix broken link of RawFd in TcpSocket docs (#7416)
  • 2506c9f benches: revert "properly gate unix benches" (#7412)
  • b3a1448 sync: improve docs of tokio_util::sync::CancellationToken (#7408)
  • 013f323 docs: add a missing panic scenario of time::advance (#7394)
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.45.1 to 1.46.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](tokio-rs/tokio@tokio-1.45.1...tokio-1.46.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.46.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added Build | Project System Compiling and Packaging Dependencies Related to Dependencies labels Jul 2, 2025
@codecov
Copy link

codecov bot commented Jul 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.50%. Comparing base (7b1c190) to head (ec7ea65).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1598      +/-   ##
===========================================
- Coverage    85.52%   85.50%   -0.02%     
===========================================
  Files          289      289              
  Lines        22842    22842              
  Branches     22842    22842              
===========================================
- Hits         19535    19532       -3     
- Misses        2986     2991       +5     
+ Partials       321      319       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

grmbyrn pushed a commit to grmbyrn/torrust-tracker that referenced this pull request Jul 3, 2025
…time metric and update atomic

It also fixes a division by zero bug when the metrics is updated before
the counter for number of conenctions has been increased.

It only avoid the division by zero. I will propoerly fixed with
independent request counter for the moving average calculation.
grmbyrn pushed a commit to grmbyrn/torrust-tracker that referenced this pull request Jul 3, 2025
… time metric and update atomic

It also fixes a division by zero bug when the metrics is updated before
the counter for number of conenctions has been increased.

It only avoid the division by zero. I will propoerly fixed with
independent request counter for the moving average calculation.
grmbyrn pushed a commit to grmbyrn/torrust-tracker that referenced this pull request Jul 3, 2025
…ime metric and update atomic

It also fixes a division by zero bug when the metrics is updated before
the counter for number of conenctions has been increased.

It only avoid the division by zero. I will propoerly fixed with
independent request counter for the moving average calculation.
grmbyrn pushed a commit to grmbyrn/torrust-tracker that referenced this pull request Jul 3, 2025
b423bf6 refactor: [torrust#1589] improve readability of UDP performance metrics race condition test (Jose Celano)
dc8d4a9 test: [torrust#1589] add race condition test for UDP performance metrics (Jose Celano)
a9acca5 refactor: [torrust#1589] rename methods and remove unused code (Jose Celano)
4c082fa refactor: [torrust#1589] make methods private (Jose Celano)
cd57f7a fix: [torrust#1589] use average aggregation for UDP processing time metrics (Jose Celano)
ba3d8a9 fix: format (Jose Celano)
caa69ae test: [torrust#1589] remove uneeded test (Jose Celano)
f402b02 chore: remove deprecated comment (Jose Celano)
8fbcf90 refactor(metrics): extract collect_matching_samples to Metric<T> impl (Jose Celano)
384b887 feat(metrics): [torrust#1589] add Avg (average) aggregate function (Jose Celano)
ed5f1e6 fix: [torrust#1589] add dedicated metric for UDP request processing in moving average calculation (Jose Celano)
164de92 refactor: [torrust#1589] remvoe duplicate code (Jose Celano)
1c13b12 fix: [torrust#1589] partially. Moving average calculated for each time series (Jose Celano)
47c2949 refactor: [torrust#1598] make recalculate udp avg scrape processing time metric and update atomic (Jose Celano)
59fbb39 refactor: [torrust#1598] make recalculate udp avg announce processing time metric and update atomic (Jose Celano)
d50948e refactor: [torrust#1598] make recalculate udp avg connect processing time metric and update atomic (Jose Celano)
e6c05b6 refactor(udp-tracker-server): [torrust#1589] move average processing time calculation from Repository to Metrics (Jose Celano)

Pull request description:

  Fix bug: Wrong UDP Average Connect Time metric.

  ### Context

  See torrust#1589.

  ### Subtasks

  - [x] Read, recalculate, and update average should be atomic.
  - [x] Average should be calculated for a time series (label set). We are mixing series: we update the average using a label set (segregate average), but count the requests for the average globally (not segregated).
  - [x] Add a new metric to count requests for the moving average. This counter is also increased atomically when the new average is updated.
  - [x] Fix global (all trackers, no labels) value for the average. It should be the average of all average samples, not the `SUM`.
    - [x] Add new average aggregate function to the `metrics` package.
  - [x] Add tests:
      - [x] With two times series. Two trackers running on different ports (`6868`, `6969`)
      - [x] For race conditions, running multiple requests in parallel. To ensure the average is accurate after many iterations.

  ### How to test

  1. Run the tracker: `cargo run`
  2. Simulate one `announce` request per UDP server

  ```
  cargo run -p torrust-tracker-client --bin udp_tracker_client announce udp://127.0.0.1:6868 000620bbc6c52d5a96d98f6c0f1dfa523a40df82 | jq

  cargo run -p torrust-tracker-client --bin udp_tracker_client announce udp://127.0.0.1:6969 000620bbc6c52d5a96d98f6c0f1dfa523a40df82 | jq
  ```

  3. Check metrics

  In the labelled metrics, there should be two metric samples like these:

  curl -s "http://localhost:1212/api/v1/metrics?token=MyAccessToken&format=prometheus"

  ```
  # HELP udp_tracker_server_performance_avg_processing_time_ns Average time to process a UDP request in nanoseconds
  # TYPE udp_tracker_server_performance_avg_processing_time_ns gauge
  udp_tracker_server_performance_avg_processing_time_ns{request_kind="announce",server_binding_address_ip_family="inet",server_binding_address_ip_type="plain",server_binding_ip="0.0.0.0",server_binding_port="6868",server_binding_protocol="udp"} 54773
  udp_tracker_server_performance_avg_processing_time_ns{request_kind="connect",server_binding_address_ip_family="inet",server_binding_address_ip_type="plain",server_binding_ip="0.0.0.0",server_binding_port="6868",server_binding_protocol="udp"} 40326
  udp_tracker_server_performance_avg_processing_time_ns{request_kind="announce",server_binding_address_ip_family="inet",server_binding_address_ip_type="plain",server_binding_ip="0.0.0.0",server_binding_port="6969",server_binding_protocol="udp"} 66063.71428571429
  udp_tracker_server_performance_avg_processing_time_ns{request_kind="connect",server_binding_address_ip_family="inet",server_binding_address_ip_type="plain",server_binding_ip="0.0.0.0",server_binding_port="6969",server_binding_protocol="udp"} 43497.71428571428
  ```

  In the global aggregated metrics:

  curl -s "http://localhost:1212/api/v1/metrics?token=MyAccessToken&format=prometheus"

  The values should be the average of the server's averages:

  ```
  udp_avg_connect_processing_time_ns 41911
  udp_avg_announce_processing_time_ns 60418
  udp_avg_scrape_processing_time_ns 0
  ```

  41911 = (40326 + 43497.71428571428)/2 = 41911,857142857
  60418 = (54773 + 66063.71428571429)/2 = 60418,357142857

  The values are rounded because we use a u64 for the global aggregated metrics.

ACKs for top commit:
  josecelano:
    ACK b423bf6

Tree-SHA512: 3d2544860838d0817f0700587af87bc6890eaef596db6cc15d02340e2ad9e459e425d2589d4e5c542ec3f0fc250b6e49fb4964be343e670a13d1de3a59b8f712
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Jul 4, 2025

Superseded by #1599.

@dependabot dependabot bot closed this Jul 4, 2025
@dependabot dependabot bot deleted the dependabot/cargo/develop/tokio-1.46.0 branch July 4, 2025 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build | Project System Compiling and Packaging Dependencies Related to Dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant