Skip to content

Commit 5cb6289

Browse files
committed
Merge tokio-1.43.4 into tokio-1.47.x
2 parents 3762a6a + dfb0f00 commit 5cb6289

File tree

7 files changed

+28
-268
lines changed

7 files changed

+28
-268
lines changed

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
only_if: $CIRRUS_TAG == '' && ($CIRRUS_PR != '' || $CIRRUS_BRANCH == 'master' || $CIRRUS_BRANCH =~ 'tokio-.*')
22
auto_cancellation: $CIRRUS_BRANCH != 'master' && $CIRRUS_BRANCH !=~ 'tokio-.*'
33
freebsd_instance:
4-
image_family: freebsd-14-2
4+
image_family: freebsd-14-3
55
env:
66
RUST_STABLE: stable
77
RUST_NIGHTLY: nightly-2025-01-25

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,21 +1078,21 @@ jobs:
10781078
run: cargo test -p tokio --target ${{ matrix.target }} --features full
10791079
env:
10801080
CARGO_TARGET_WASM32_WASIP1_RUNNER: "wasmtime run --"
1081-
CARGO_TARGET_WASM32_WASIP1_THREADS_RUNNER: "wasmtime run -W bulk-memory=y -W threads=y -S threads=y --"
1081+
CARGO_TARGET_WASM32_WASIP1_THREADS_RUNNER: "wasmtime run -W bulk-memory=y -W threads=y -W shared-memory=y -S threads=y --"
10821082
RUSTFLAGS: --cfg tokio_unstable -Dwarnings -C target-feature=+atomics,+bulk-memory -C link-args=--max-memory=67108864
10831083

10841084
- name: WASI test tokio-util full
10851085
run: cargo test -p tokio-util --target ${{ matrix.target }} --features full
10861086
env:
10871087
CARGO_TARGET_WASM32_WASIP1_RUNNER: "wasmtime run --"
1088-
CARGO_TARGET_WASM32_WASIP1_THREADS_RUNNER: "wasmtime run -W bulk-memory=y -W threads=y -S threads=y --"
1088+
CARGO_TARGET_WASM32_WASIP1_THREADS_RUNNER: "wasmtime run -W bulk-memory=y -W threads=y -W shared-memory=y -S threads=y --"
10891089
RUSTFLAGS: --cfg tokio_unstable -Dwarnings -C target-feature=+atomics,+bulk-memory -C link-args=--max-memory=67108864
10901090

10911091
- name: WASI test tokio-stream
10921092
run: cargo test -p tokio-stream --target ${{ matrix.target }} --features time,net,io-util,sync
10931093
env:
10941094
CARGO_TARGET_WASM32_WASIP1_RUNNER: "wasmtime run --"
1095-
CARGO_TARGET_WASM32_WASIP1_THREADS_RUNNER: "wasmtime run -W bulk-memory=y -W threads=y -S threads=y --"
1095+
CARGO_TARGET_WASM32_WASIP1_THREADS_RUNNER: "wasmtime run -W bulk-memory=y -W threads=y -W shared-memory=y -S threads=y --"
10961096
RUSTFLAGS: --cfg tokio_unstable -Dwarnings -C target-feature=+atomics,+bulk-memory -C link-args=--max-memory=67108864
10971097

10981098
- name: test tests-integration --features wasi-rt
@@ -1109,7 +1109,7 @@ jobs:
11091109
if: matrix.target == 'wasm32-wasip1-threads'
11101110
working-directory: tests-integration
11111111
env:
1112-
CARGO_TARGET_WASM32_WASIP1_THREADS_RUNNER: "wasmtime run -W bulk-memory=y -W threads=y -S threads=y --"
1112+
CARGO_TARGET_WASM32_WASIP1_THREADS_RUNNER: "wasmtime run -W bulk-memory=y -W threads=y -W shared-memory=y -S threads=y --"
11131113
RUSTFLAGS: --cfg tokio_unstable -Dwarnings -C target-feature=+atomics,+bulk-memory -C link-args=--max-memory=67108864
11141114

11151115
check-external-types:

tokio/CHANGELOG.md

Lines changed: 3 additions & 260 deletions
Original file line numberDiff line numberDiff line change
@@ -1,267 +1,10 @@
1-
# 1.47.2 (October 14th, 2025)
1+
# 1.43.4 (January 3rd, 2026)
22

33
### Fixed
44

5-
- runtime: use release ordering in `wake_by_ref()` even if already woken ([#7622])
6-
- sync: close the `broadcast::Sender` in `broadcast::Sender::new()` ([#7629])
7-
- macros: fix hygiene issue in `join!` and `try_join!` ([#7638])
8-
- process: fix error when runtime is shut down on nightly-2025-10-12 ([#7672])
9-
10-
[#7622]: https://github.com/tokio-rs/tokio/pull/7622
11-
[#7629]: https://github.com/tokio-rs/tokio/pull/7629
12-
[#7638]: https://github.com/tokio-rs/tokio/pull/7638
13-
[#7672]: https://github.com/tokio-rs/tokio/pull/7672
14-
15-
# 1.47.1 (August 1st, 2025)
16-
17-
### Fixed
18-
19-
- process: fix panic from spurious pidfd wakeup ([#7494])
20-
- sync: fix broken link of Python `asyncio.Event` in `SetOnce` docs ([#7485])
21-
22-
[#7485]: https://github.com/tokio-rs/tokio/pull/7485
23-
24-
# 1.47.0 (July 25th, 2025)
25-
26-
This release adds `poll_proceed` and `cooperative` to the `coop` module for
27-
cooperative scheduling, adds `SetOnce` to the `sync` module which provides
28-
similar functionality to [`std::sync::OnceLock], and adds a new method
29-
`sync::Notify::notified_owned()` which returns an `OwnedNotified` without
30-
a lifetime parameter.
31-
32-
## Added
33-
34-
- coop: add `cooperative` and `poll_proceed` ([#7405])
35-
- sync: add `SetOnce` ([#7418])
36-
- sync: add `sync::Notify::notified_owned()` ([#7465])
37-
38-
## Changed
39-
40-
- deps: upgrade windows-sys 0.52 → 0.59 ([#7117])
41-
- deps: update to socket2 v0.6 ([#7443])
42-
- sync: improve `AtomicWaker::wake` performance ([#7450])
43-
44-
## Documented
45-
46-
- metrics: fix listed feature requirements for some metrics ([#7449])
47-
- runtime: improve safety comments of `Readiness<'_>` ([#7415])
48-
49-
[#7405]: https://github.com/tokio-rs/tokio/pull/7405
50-
[#7415]: https://github.com/tokio-rs/tokio/pull/7415
51-
[#7418]: https://github.com/tokio-rs/tokio/pull/7418
52-
[#7449]: https://github.com/tokio-rs/tokio/pull/7449
53-
[#7450]: https://github.com/tokio-rs/tokio/pull/7450
54-
[#7465]: https://github.com/tokio-rs/tokio/pull/7465
55-
56-
# 1.46.1 (July 4th, 2025)
57-
58-
This release fixes incorrect spawn locations in runtime task hooks for tasks
59-
spawned using `tokio::spawn` rather than `Runtime::spawn`. This issue only
60-
effected the spawn location in `TaskMeta::spawned_at`, and did not effect task
61-
locations in Tracing events.
62-
63-
## Unstable
64-
65-
- runtime: add `TaskMeta::spawn_location` tracking where a task was spawned
66-
([#7440])
67-
68-
[#7440]: https://github.com/tokio-rs/tokio/pull/7440
69-
70-
# 1.46.0 (July 2nd, 2025)
71-
72-
## Fixed
73-
74-
- net: fixed `TcpStream::shutdown` incorrectly returning an error on macOS ([#7290])
75-
76-
## Added
77-
78-
- sync: `mpsc::OwnedPermit::{same_channel, same_channel_as_sender}` methods ([#7389])
79-
- macros: `biased` option for `join!` and `try_join!`, similar to `select!` ([#7307])
80-
- net: support for cygwin ([#7393])
81-
- net: support `pipe::OpenOptions::read_write` on Android ([#7426])
82-
- net: add `Clone` implementation for `net::unix::SocketAddr` ([#7422])
83-
84-
## Changed
85-
86-
- runtime: eliminate unnecessary lfence while operating on `queue::Local<T>` ([#7340])
87-
- task: disallow blocking in `LocalSet::{poll,drop}` ([#7372])
88-
89-
## Unstable
90-
91-
- runtime: add `TaskMeta::spawn_location` tracking where a task was spawned ([#7417])
92-
- runtime: removed borrow from `LocalOptions` parameter to `runtime::Builder::build_local` ([#7346])
93-
94-
## Documented
95-
96-
- io: clarify behavior of seeking when `start_seek` is not used ([#7366])
97-
- io: document cancellation safety of `AsyncWriteExt::flush` ([#7364])
98-
- net: fix docs for `recv_buffer_size` method ([#7336])
99-
- net: fix broken link of `RawFd` in `TcpSocket` docs ([#7416])
100-
- net: update `AsRawFd` doc link to current Rust stdlib location ([#7429])
101-
- readme: fix double period in reactor description ([#7363])
102-
- runtime: add doc note that `on_*_task_poll` is unstable ([#7311])
103-
- sync: update broadcast docs on allocation failure ([#7352])
104-
- time: add a missing panic scenario of `time::advance` ([#7394])
105-
106-
[#7290]: https://github.com/tokio-rs/tokio/pull/7290
107-
[#7307]: https://github.com/tokio-rs/tokio/pull/7307
108-
[#7311]: https://github.com/tokio-rs/tokio/pull/7311
109-
[#7336]: https://github.com/tokio-rs/tokio/pull/7336
110-
[#7340]: https://github.com/tokio-rs/tokio/pull/7340
111-
[#7346]: https://github.com/tokio-rs/tokio/pull/7346
112-
[#7352]: https://github.com/tokio-rs/tokio/pull/7352
113-
[#7363]: https://github.com/tokio-rs/tokio/pull/7363
114-
[#7364]: https://github.com/tokio-rs/tokio/pull/7364
115-
[#7366]: https://github.com/tokio-rs/tokio/pull/7366
116-
[#7372]: https://github.com/tokio-rs/tokio/pull/7372
117-
[#7389]: https://github.com/tokio-rs/tokio/pull/7389
118-
[#7393]: https://github.com/tokio-rs/tokio/pull/7393
119-
[#7394]: https://github.com/tokio-rs/tokio/pull/7394
120-
[#7416]: https://github.com/tokio-rs/tokio/pull/7416
121-
[#7422]: https://github.com/tokio-rs/tokio/pull/7422
122-
[#7426]: https://github.com/tokio-rs/tokio/pull/7426
123-
[#7429]: https://github.com/tokio-rs/tokio/pull/7429
124-
[#7417]: https://github.com/tokio-rs/tokio/pull/7417
125-
126-
# 1.45.1 (May 24th, 2025)
127-
128-
This fixes a regression on the wasm32-unknown-unknown target, where code that
129-
previously did not panic due to calls to `Instant::now()` started failing. This
130-
is due to the stabilization of the first time-based metric.
131-
132-
### Fixed
133-
134-
- Disable time-based metrics on wasm32-unknown-unknown ([#7322])
135-
136-
[#7322]: https://github.com/tokio-rs/tokio/pull/7322
137-
138-
# 1.45.0 (May 5th, 2025)
139-
140-
### Added
141-
142-
- metrics: stabilize `worker_total_busy_duration`, `worker_park_count`, and
143-
`worker_unpark_count` ([#6899], [#7276])
144-
- process: add `Command::spawn_with` ([#7249])
145-
146-
### Changed
147-
148-
- io: do not require `Unpin` for some trait impls ([#7204])
149-
- rt: mark `runtime::Handle` as unwind safe ([#7230])
150-
- time: revert internal sharding implementation ([#7226])
151-
152-
### Unstable
153-
154-
- rt: remove alt multi-threaded runtime ([#7275])
155-
156-
[#6899]: https://github.com/tokio-rs/tokio/pull/6899
157-
[#7276]: https://github.com/tokio-rs/tokio/pull/7276
158-
[#7249]: https://github.com/tokio-rs/tokio/pull/7249
159-
[#7204]: https://github.com/tokio-rs/tokio/pull/7204
160-
[#7230]: https://github.com/tokio-rs/tokio/pull/7230
161-
[#7226]: https://github.com/tokio-rs/tokio/pull/7226
162-
[#7275]: https://github.com/tokio-rs/tokio/pull/7275
163-
164-
165-
# 1.44.2 (April 5th, 2025)
166-
167-
This release fixes a soundness issue in the broadcast channel. The channel
168-
accepts values that are `Send` but `!Sync`. Previously, the channel called
169-
`clone()` on these values without synchronizing. This release fixes the channel
170-
by synchronizing calls to `.clone()` (Thanks Austin Bonander for finding and
171-
reporting the issue).
172-
173-
### Fixed
174-
175-
- sync: synchronize `clone()` call in broadcast channel ([#7232])
176-
177-
[#7232]: https://github.com/tokio-rs/tokio/pull/7232
178-
179-
# 1.44.1 (March 13th, 2025)
180-
181-
### Fixed
182-
183-
- rt: skip defer queue in `block_in_place` context ([#7216])
184-
185-
[#7216]: https://github.com/tokio-rs/tokio/pull/7216
186-
187-
# 1.44.0 (March 7th, 2025)
188-
189-
This release changes the `from_std` method on sockets to panic if a blocking
190-
socket is provided. We determined this change is not a breaking change as Tokio is not
191-
intended to operate using blocking sockets. Doing so results in runtime hangs and
192-
should be considered a bug. Accidentally passing a blocking socket to Tokio is one
193-
of the most common user mistakes. If this change causes an issue for you, please
194-
comment on [#7172].
195-
196-
### Added
197-
198-
- coop: add `task::coop` module ([#7116])
199-
- process: add `Command::get_kill_on_drop()` ([#7086])
200-
- sync: add `broadcast::Sender::closed` ([#6685], [#7090])
201-
- sync: add `broadcast::WeakSender` ([#7100])
202-
- sync: add `oneshot::Receiver::is_empty()` ([#7153])
203-
- sync: add `oneshot::Receiver::is_terminated()` ([#7152])
204-
205-
### Fixed
206-
207-
- fs: empty reads on `File` should not start a background read ([#7139])
208-
- process: calling `start_kill` on exited child should not fail ([#7160])
209-
- signal: fix `CTRL_CLOSE`, `CTRL_LOGOFF`, `CTRL_SHUTDOWN` on windows ([#7122])
210-
- sync: properly handle panic during mpsc drop ([#7094])
211-
212-
### Changes
213-
214-
- runtime: clean up magic number in registration set ([#7112])
215-
- coop: make coop yield using waker defer strategy ([#7185])
216-
- macros: make `select!` budget-aware ([#7164])
217-
- net: panic when passing a blocking socket to `from_std` ([#7166])
218-
- io: clean up buffer casts ([#7142])
219-
220-
### Changes to unstable APIs
221-
222-
- rt: add before and after task poll callbacks ([#7120])
223-
- tracing: make the task tracing API unstable public ([#6972])
224-
225-
### Documented
5+
* sync: return `TryRecvError::Disconnected` from `Receiver::try_recv` after `Receiver::close` ([#7686])
2266

227-
- docs: fix nesting of sections in top-level docs ([#7159])
228-
- fs: rename symlink and hardlink parameter names ([#7143])
229-
- io: swap reader/writer in simplex doc test ([#7176])
230-
- macros: docs about `select!` alternatives ([#7110])
231-
- net: rename the argument for `send_to` ([#7146])
232-
- process: add example for reading `Child` stdout ([#7141])
233-
- process: clarify `Child::kill` behavior ([#7162])
234-
- process: fix grammar of the `ChildStdin` struct doc comment ([#7192])
235-
- runtime: consistently use `worker_threads` instead of `core_threads` ([#7186])
236-
237-
[#6685]: https://github.com/tokio-rs/tokio/pull/6685
238-
[#6972]: https://github.com/tokio-rs/tokio/pull/6972
239-
[#7086]: https://github.com/tokio-rs/tokio/pull/7086
240-
[#7090]: https://github.com/tokio-rs/tokio/pull/7090
241-
[#7094]: https://github.com/tokio-rs/tokio/pull/7094
242-
[#7100]: https://github.com/tokio-rs/tokio/pull/7100
243-
[#7110]: https://github.com/tokio-rs/tokio/pull/7110
244-
[#7112]: https://github.com/tokio-rs/tokio/pull/7112
245-
[#7116]: https://github.com/tokio-rs/tokio/pull/7116
246-
[#7120]: https://github.com/tokio-rs/tokio/pull/7120
247-
[#7122]: https://github.com/tokio-rs/tokio/pull/7122
248-
[#7139]: https://github.com/tokio-rs/tokio/pull/7139
249-
[#7141]: https://github.com/tokio-rs/tokio/pull/7141
250-
[#7142]: https://github.com/tokio-rs/tokio/pull/7142
251-
[#7143]: https://github.com/tokio-rs/tokio/pull/7143
252-
[#7146]: https://github.com/tokio-rs/tokio/pull/7146
253-
[#7152]: https://github.com/tokio-rs/tokio/pull/7152
254-
[#7153]: https://github.com/tokio-rs/tokio/pull/7153
255-
[#7159]: https://github.com/tokio-rs/tokio/pull/7159
256-
[#7160]: https://github.com/tokio-rs/tokio/pull/7160
257-
[#7162]: https://github.com/tokio-rs/tokio/pull/7162
258-
[#7164]: https://github.com/tokio-rs/tokio/pull/7164
259-
[#7166]: https://github.com/tokio-rs/tokio/pull/7166
260-
[#7172]: https://github.com/tokio-rs/tokio/pull/7172
261-
[#7176]: https://github.com/tokio-rs/tokio/pull/7176
262-
[#7185]: https://github.com/tokio-rs/tokio/pull/7185
263-
[#7186]: https://github.com/tokio-rs/tokio/pull/7186
264-
[#7192]: https://github.com/tokio-rs/tokio/pull/7192
7+
[#7686]: https://github.com/tokio-rs/tokio/pull/7686
2658

2669
# 1.43.3 (October 14th, 2025)
26710

tokio/src/sync/mpsc/chan.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,10 @@ impl<T, S: Semaphore> Rx<T, S> {
439439
return Ok(value);
440440
}
441441
TryPopResult::Closed => return Err(TryRecvError::Disconnected),
442+
// If close() was called, an empty queue should report Disconnected.
443+
TryPopResult::Empty if rx_fields.rx_closed => {
444+
return Err(TryRecvError::Disconnected)
445+
}
442446
TryPopResult::Empty => return Err(TryRecvError::Empty),
443447
TryPopResult::Busy => {} // fall through
444448
}

tokio/src/sync/mpsc/list.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,14 @@ pub(crate) enum TryPopResult<T> {
3535
/// Successfully popped a value.
3636
Ok(T),
3737
/// The channel is empty.
38+
///
39+
/// Note that `list.rs` only tracks the close state set by senders. If the
40+
/// channel is closed by `Rx::close()`, then `TryPopResult::Empty` is still
41+
/// returned, and the close state needs to be handled by `chan.rs`.
3842
Empty,
3943
/// The channel is empty and closed.
44+
///
45+
/// Returned when the send half is closed (all senders dropped).
4046
Closed,
4147
/// The channel is not empty, but the first value is being written.
4248
Busy,

tokio/tests/sync_broadcast.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ use wasm_bindgen_test::wasm_bindgen_test as test;
77

88
use tokio::sync::broadcast;
99
use tokio_test::task;
10-
use tokio_test::{
11-
assert_err, assert_ok, assert_pending, assert_ready, assert_ready_err, assert_ready_ok,
12-
};
10+
use tokio_test::{assert_err, assert_ok, assert_pending, assert_ready_err, assert_ready_ok};
1311

1412
use std::sync::Arc;
1513

tokio/tests/sync_mpsc.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,15 @@ fn try_recv_unbounded() {
966966
}
967967
}
968968

969+
#[test]
970+
fn try_recv_after_receiver_close() {
971+
let (_tx, mut rx) = mpsc::channel::<()>(5);
972+
973+
assert_eq!(Err(TryRecvError::Empty), rx.try_recv());
974+
rx.close();
975+
assert_eq!(Err(TryRecvError::Disconnected), rx.try_recv());
976+
}
977+
969978
#[test]
970979
fn try_recv_close_while_empty_bounded() {
971980
let (tx, mut rx) = mpsc::channel::<()>(5);

0 commit comments

Comments
 (0)