Skip to content

Commit

Permalink
Merge 'tokio-1.38.1' into 'master' (#6689)
Browse files Browse the repository at this point in the history
  • Loading branch information
wathenjiang committed Jul 16, 2024
2 parents 1e28668 + 14b9f71 commit c028062
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml:

```toml
[dependencies]
tokio = { version = "1.38.0", features = ["full"] }
tokio = { version = "1.38.1", features = ["full"] }
```
Then, on your main.rs:

Expand Down
12 changes: 12 additions & 0 deletions tokio/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# 1.38.1 (July 16th, 2024)

This release fixes the bug identified as ([#6682]), which caused timers not
to fire when they should.

### Fixed

- time: update `wake_up` while holding all the locks of sharded time wheels ([#6683])

[#6682]: https://github.com/tokio-rs/tokio/pull/6682
[#6683]: https://github.com/tokio-rs/tokio/pull/6683

# 1.38.0 (May 30th, 2024)

This release marks the beginning of stabilization for runtime metrics. It
Expand Down
2 changes: 1 addition & 1 deletion tokio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name = "tokio"
# - README.md
# - Update CHANGELOG.md.
# - Create "v1.x.y" git tag.
version = "1.38.0"
version = "1.38.1"
edition = "2021"
rust-version = "1.63"
authors = ["Tokio Contributors <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion tokio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Make sure you activated the full features of the tokio crate on Cargo.toml:

```toml
[dependencies]
tokio = { version = "1.38.0", features = ["full"] }
tokio = { version = "1.38.1", features = ["full"] }
```
Then, on your main.rs:

Expand Down
15 changes: 10 additions & 5 deletions tokio/src/runtime/time/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,13 @@ impl Driver {
assert!(!handle.is_shutdown());

// Finds out the min expiration time to park.
let expiration_time = (0..rt_handle.time().inner.get_shard_size())
.filter_map(|id| {
let lock = rt_handle.time().inner.lock_sharded_wheel(id);
lock.next_expiration_time()
})
let locks = (0..rt_handle.time().inner.get_shard_size())
.map(|id| rt_handle.time().inner.lock_sharded_wheel(id))
.collect::<Vec<_>>();

let expiration_time = locks
.iter()
.filter_map(|lock| lock.next_expiration_time())
.min();

rt_handle
Expand All @@ -203,6 +205,9 @@ impl Driver {
.next_wake
.store(next_wake_time(expiration_time));

// Safety: After updating the `next_wake`, we drop all the locks.
drop(locks);

match expiration_time {
Some(when) => {
let now = handle.time_source.now(rt_handle.clock());
Expand Down

0 comments on commit c028062

Please sign in to comment.