Skip to content

Releases: tokio-rs/tokio

Tokio v1.18.1

02 May 15:26
148bea8
Compare
Choose a tag to compare

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

27 Apr 17:31
4818343
Compare
Choose a tag to compare

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 (Ids
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] for spawn_blocking (#4616)
  • macros: fix select macro to process 64 branches (#4519)
  • net: fix try_io methods not calling Mio's try_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 and c_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 for RecvError types (#4560)

Changed

  • update mio to 0.8.1 (#4582)
  • macros: rename tokio::select!'s internal util 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 mention EnterGuard (#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:

  • task: add task::Id type (#4630)
  • task: add AbortHandle type for cancelling tasks in a JoinSet (#4530],
    [#4640)
  • task: fix missing doc(cfg(...)) attributes for JoinSet (#4531)
  • task: fix broken link in AbortHandle RustDoc (#4545)
  • metrics: add initial IO driver metrics (#4507)

Tokio v1.17.0

16 Feb 18:53
43c224f
Compare
Choose a tag to compare

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
    where Instant::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 own Ready future
    (#4271)
  • replace deprecated atomic::spin_loop_hint with hint::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:

  • task: fix missing location information in tracing spans generated by
    spawn_local (#4483)
  • task: add JoinSet for managing sets of tasks (#4335)
  • metrics: fix compilation error on MIPS (#4475)
  • metrics: fix compilation error on arm32v7 (#4453)

Tokio v1.14.1

31 Jan 21:03
b4077a5
Compare
Choose a tag to compare

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

30 Jan 19:47
Compare
Choose a tag to compare

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

28 Jan 10:23
91b9850
Compare
Choose a tag to compare

1.16.1 (January 28, 2022)

This release fixes a bug in #4428 with the change #4437.

Tokio v1.16.0

27 Jan 23:24
afd2189
Compare
Choose a tag to compare

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 a write 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 from parking_lot::*Guard (#4359)

Added

  • net: TcpSocket::linger() and set_linger() (#4324)
  • net: impl UnwindSafe for socket types (#4384)
  • rt: impl UnwindSafe for JoinHandle (#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

15 Dec 18:52
f646735
Compare
Choose a tag to compare

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

17 Nov 18:01
Compare
Choose a tag to compare

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)

Tokio v1.14.0

22 Nov 17:47
884a9a4
Compare
Choose a tag to compare

1.14.0 (November 15, 2021)

Fixed

  • macros: fix compiler errors when using mut patterns in select! (#4211)
  • sync: fix a data race between oneshot::Sender::send and awaiting a
    oneshot::Receiver when the oneshot has been closed (#4226)
  • sync: make AtomicWaker panic safe (#3689)
  • runtime: fix basic scheduler dropping tasks outside a runtime context
    (#4213)

Added

  • stats: add RuntimeStats::busy_duration_total (#4179, #4223)

Changed

  • io: updated copy buffer size to match std::io::copy (#4209)

Documented

  • io: rename buffer to file in doc-test (#4230)
  • sync: fix Notify example (#4212)