Releases: tokio-rs/tokio
Tokio v1.18.2
1.18.2 (May 5, 2022)
Add missing features for the winapi
dependency. (#4663)
Tokio v1.18.1
1.18.1 (May 2, 2022)
The 1.18.0 release broke the build for targets without 64-bit atomics when building with tokio_unstable
. This release fixes that. (#4649)
Tokio v1.18.0
1.18.0 (April 27, 2022)
This release adds a number of new APIs in tokio::net
, tokio::signal
, and
tokio::sync
. In addition, it adds new unstable APIs to tokio::task
(Id
s
for uniquely identifying a task, and AbortHandle
for remotely cancelling a
task), as well as a number of bugfixes.
Fixed
- blocking: add missing
#[track_caller]
forspawn_blocking
(#4616) - macros: fix
select
macro to process 64 branches (#4519) - net: fix
try_io
methods not calling Mio'stry_io
internally (#4582) - runtime: recover when OS fails to spawn a new thread (#4485)
Added
- net: add
UdpSocket::peer_addr
(#4611) - net: add
try_read_buf
method for named pipes (#4626) - signal: add
SignalKind
Hash
/Eq
impls andc_int
conversion (#4540) - signal: add support for signals up to
SIGRTMAX
(#4555) - sync: add
watch::Sender::send_modify
method (#4310) - sync: add
broadcast::Receiver::len
method (#4542) - sync: add
watch::Receiver::same_channel
method (#4581) - sync: implement
Clone
forRecvError
types (#4560)
Changed
- update
mio
to 0.8.1 (#4582) - macros: rename
tokio::select!
's internalutil
module (#4543) - runtime: use
Vec::with_capacity
when building runtime (#4553)
Documented
- improve docs for
tokio_unstable
(#4524) - runtime: include more documentation for thread_pool/worker (#4511)
- runtime: update
Handle::current
's docs to mentionEnterGuard
(#4567) - time: clarify platform specific timer resolution (#4474)
- signal: document that
Signal::recv
is cancel-safe (#4634) - sync:
UnboundedReceiver
close docs (#4548)
Unstable
The following changes only apply when building with --cfg tokio_unstable
:
Tokio v1.17.0
1.17.0 (February 15, 2022)
This release updates the minimum supported Rust version (MSRV) to 1.49,
the mio
dependency to v0.8, and the (optional) parking_lot
dependency to v0.12. Additionally, it contains several bug fixes, as
well as internal refactoring and performance improvements.
Fixed
- time: prevent panicking in
sleep
with large durations (#4495) - time: eliminate potential panics in
Instant
arithmetic on platforms
whereInstant::now
is not monotonic (#4461) - io: fix
DuplexStream
not participating in cooperative yielding
(#4478) - rt: fix potential double panic when dropping a
JoinHandle
(#4430)
Changed
- update minimum supported Rust version to 1.49 (#4457)
- update
parking_lot
dependency to v0.12.0 (#4459) - update
mio
dependency to v0.8 (#4449) - rt: remove an unnecessary lock in the blocking pool (#4436)
- rt: remove an unnecessary enum in the basic scheduler (#4462)
- time: use bit manipulation instead of modulo to improve performance
(#4480) - net: use
std::future::Ready
instead of our ownReady
future
(#4271) - replace deprecated
atomic::spin_loop_hint
withhint::spin_loop
(#4491) - fix miri failures in intrusive linked lists (#4397)
Documented
- io: add an example for
tokio::process::ChildStdin
(#4479)
Unstable
The following changes only apply when building with --cfg tokio_unstable
:
Tokio v1.14.1
This release backports a bug fix from 1.16.1
Fixes a soundness bug in io::Take
(#4428). The unsoundness is exposed when
leaking memory in the given AsyncRead
implementation and then overwriting the
supplied buffer:
impl AsyncRead for Buggy {
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut ReadBuf<'_>
) -> Poll<Result<()>> {
let new_buf = vec![0; 5].leak();
*buf = ReadBuf::new(new_buf);
buf.put_slice(b"hello");
Poll::Ready(Ok(()))
}
}
Fixed
- io: soundness don't expose uninitialized memory when using
io::Take
in edge case (#4428)
Tokio v1.8.5
This release backports a bug fix from 1.16.1
Fixes a soundness bug in io::Take
(#4428). The unsoundness is exposed when
leaking memory in the given AsyncRead
implementation and then overwriting the
supplied buffer:
impl AsyncRead for Buggy {
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut ReadBuf<'_>
) -> Poll<Result<()>> {
let new_buf = vec![0; 5].leak();
*buf = ReadBuf::new(new_buf);
buf.put_slice(b"hello");
Poll::Ready(Ok(()))
}
}
Fixed
- io: soundness don't expose uninitialized memory when using
io::Take
in edge case (#4428)
Tokio v1.16.1
Tokio v1.16.0
Fixes a soundness bug in io::Take
(#4428). The unsoundness is exposed when
leaking memory in the given AsyncRead
implementation and then overwriting the
supplied buffer:
impl AsyncRead for Buggy {
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut ReadBuf<'_>
) -> Poll<Result<()>> {
let new_buf = vec![0; 5].leak();
*buf = ReadBuf::new(new_buf);
buf.put_slice(b"hello");
Poll::Ready(Ok(()))
}
}
Also, this release includes improvements to the multi-threaded scheduler that
can increase throughput by up to 20% in some cases (#4383).
Fixed
- io: soundness don't expose uninitialized memory when using
io::Take
in edge case (#4428) - fs: ensure
File::write
results in awrite
syscall when the runtime shuts down (#4316) - process: drop pipe after child exits in
wait_with_output
(#4315) - rt: improve error message when spawning a thread fails (#4398)
- rt: reduce false-positive thread wakups in the multi-threaded scheduler (#4383)
- sync: don't inherit
Send
fromparking_lot::*Guard
(#4359)
Added
- net:
TcpSocket::linger()
andset_linger()
(#4324) - net: impl
UnwindSafe
for socket types (#4384) - rt: impl
UnwindSafe
forJoinHandle
(#4418) - sync:
watch::Receiver::has_changed()
(#4342) - sync:
oneshot::Receiver::blocking_recv()
(#4334) - sync:
RwLock
blocking operations (#4425)
Unstable
The following changes only apply when building with --cfg tokio_unstable
- rt: breaking change overhaul runtime metrics API (#4373)
Tokio v1.15.0
Fixed
- io: add cooperative yielding support to
io::empty()
(#4300) - time: make timeout robust against budget-depleting tasks (#4314)
Changed
- update minimum supported Rust version to 1.46.
Added
- time: add
Interval::reset()
(#4248) - io: add explicit lifetimes to
AsyncFdReadyGuard
(#4267) - process: add
Command::as_std()
(#4295)
Added (unstable)
- tracing: instrument
tokio::sync
types (#4302)
Tokio v1.8.4
1.8.4 (November 15, 2021)
This release backports a bugfix for a data race when sending and receiving on a
closed oneshot
channel ([RUSTSEC-2021-0124]) from v1.13.1.
Fixed
- sync: fix a data race between
oneshot::Sender::send
and awaiting a
oneshot::Receiver
when the oneshot has been closed (#4226)