Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Rust crate tokio to v1 [SECURITY] - abandoned #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 6, 2022

Mend Renovate

This PR contains the following updates:

Package Type Update Change
tokio (source) dependencies major 0.1.7 -> 1.8.4
tokio (source) dev-dependencies major 0.1.7 -> 1.8.4

GitHub Vulnerability Alerts

CVE-2021-45710

An issue was discovered in the tokio crate before 1.8.4, and 1.9.x through 1.13.x before 1.13.1, for Rust. In certain circumstances involving a closed oneshot channel, there is a data race and memory corruption.


Release Notes

tokio-rs/tokio

v1.8.4: Tokio v1.8.4

Compare Source

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)

v1.8.3: Tokio v1.8.3

Compare Source

1.8.3 (July 22, 2021)

This release backports two fixes from 1.9.0

Fixed
  • Fix leak if output of future panics on drop (#​3967)
  • Fix leak in LocalSet (#​3978)

v1.8.2: Tokio 1.8.2

Compare Source

Fixes a missed edge case from 1.8.1.

Fixed
  • runtime: drop canceled future on next poll (#​3965)

v1.8.1: Tokio 1.8.1

Compare Source

Forward ports 1.5.1 fixes.

Fixed
  • runtime: remotely abort tasks on JoinHandle::abort (#​3934)

v1.8.0

Compare Source

1.8.0 (July 2, 2021)

Added
  • io: add get_{ref,mut} methods to AsyncFdReadyGuard and AsyncFdReadyMutGuard (#​3807)
  • io: efficient implementation of vectored writes for BufWriter (#​3163)
  • net: add ready/try methods to NamedPipe{Client,Server} (#​3866, #​3899)
  • sync: add watch::Receiver::borrow_and_update (#​3813)
  • sync: implement From<T> for OnceCell<T> (#​3877)
  • time: allow users to specify Interval behaviour when delayed (#​3721)
Added (unstable)
  • rt: add tokio::task::Builder (#​3881)
Fixed
  • net: handle HUP event with UnixStream (#​3898)
Documented
  • doc: document cancellation safety (#​3900)
  • time: add wait alias to sleep (#​3897)
  • time: document auto-advancing behaviour of runtime (#​3763)

v1.7.3: Tokio 1.7.3

Compare Source

Fixes a missed edge case from 1.7.2.

Fixed
  • runtime: drop canceled future on next poll (#​3965)

v1.7.2: Tokio v1.7.2

Compare Source

Forward ports 1.5.1 fixes.

Fixed
  • runtime: remotely abort tasks on JoinHandle::abort (#​3934)

v1.7.1: Tokio v1.7.1

Compare Source

Fixed
  • runtime: fix early task shutdown during runtime shutdown (#​3870)

v1.7.0: Tokio v1.7.0

Compare Source

1.7.0 (June 15, 2021)

Added
  • net: add named pipes on windows (#​3760)
  • net: add TcpSocket from std::net::TcpStream conversion (#​3838)
  • sync: add receiver_count to watch::Sender (#​3729)
  • sync: export sync::notify::Notified future publicly (#​3840)
  • tracing: instrument task wakers (#​3836)
Fixed
  • macros: suppress clippy::default_numeric_fallback lint in generated code (#​3831)
  • runtime: immediately drop new tasks when runtime is shut down (#​3752)
  • sync: deprecate unused mpsc::RecvError type (#​3833)
Documented
  • io: clarify EOF condition for AsyncReadExt::read_buf (#​3850)
  • io: clarify limits on return values of AsyncWrite::poll_write (#​3820)
  • sync: add examples to Semaphore (#​3808)

v1.6.4: Tokio 1.6.4

Compare Source

Fixes a missed edge case from 1.6.3.

Fixed
  • runtime: drop canceled future on next poll (#​3965)

v1.6.3: Tokio v1.6.3

Compare Source

Forward ports 1.5.1 fixes.

Fixed
  • runtime: remotely abort tasks on JoinHandle::abort (#​3934)

v1.6.2: Tokio v1.6.2

Compare Source

Fixes
  • test: sub-ms time:advance regression introduced in 1.6 (#​3852)

v1.6.1: Tokio v1.6.1

Compare Source

This release reverts #​3518 because it doesn't work on some kernels due to
a kernel bug. (#​3803)

v1.6.0: Tokio v1.6.0

Compare Source

1.6.0 (May 14, 2021)

Added
  • fs: try doing a non-blocking read before punting to the threadpool (#​3518)
  • io: add write_all_buf to AsyncWriteExt (#​3737)
  • io: implement AsyncSeek for BufReader, BufWriter, and BufStream (#​3491)
  • net: support non-blocking vectored I/O (#​3761)
  • sync: add mpsc::Sender::{reserve_owned, try_reserve_owned} (#​3704)
  • sync: add a MutexGuard::map method that returns a MappedMutexGuard (#​2472)
  • time: add getter for Interval's period (#​3705)
Fixed
  • io: wake pending writers on DuplexStream close (#​3756)
  • process: avoid redundant effort to reap orphan processes (#​3743)
  • signal: use std::os::raw::c_int instead of libc::c_int on public API (#​3774)
  • sync: preserve permit state in notify_waiters (#​3660)
  • task: update JoinHandle panic message (#​3727)
  • time: prevent time::advance from going too far (#​3712)
Documented
  • net: hide net::unix::datagram module from docs (#​3775)
  • process: updated example (#​3748)
  • sync: Barrier doc should use task, not thread (#​3780)
  • task: update documentation on block_in_place (#​3753)

v1.5.1: Tokio v1.5.1

Compare Source

Fixed
  • runtime: remotely abort tasks on JoinHandle::abort (#​3934)

v1.5.0: Tokio v1.5.0

Compare Source

1.5.0 (April 12, 2021)
Added
  • io: add AsyncSeekExt::stream_position (#​3650)
  • io: add AsyncWriteExt::write_vectored (#​3678)
  • io: add a copy_bidirectional utility (#​3572)
  • net: implement IntoRawFd for TcpSocket (#​3684)
  • sync: add OnceCell (#​3591)
  • sync: add OwnedRwLockReadGuard and OwnedRwLockWriteGuard (#​3340)
  • sync: add Semaphore::is_closed (#​3673)
  • sync: add mpsc::Sender::capacity (#​3690)
  • sync: allow configuring RwLock max reads (#​3644)
  • task: add sync_scope for LocalKey (#​3612)
Fixed
  • chore: try to avoid noalias attributes on intrusive linked list (#​3654)
  • rt: fix panic in JoinHandle::abort() when called from other threads (#​3672)
  • sync: don't panic in oneshot::try_recv (#​3674)
  • sync: fix notifications getting dropped on receiver drop (#​3652)
  • sync: fix Semaphore permit overflow calculation (#​3644)
Documented
  • io: clarify requirements of AsyncFd (#​3635)
  • runtime: fix unclear docs for {Handle,Runtime}::block_on (#​3628)
  • sync: document that Semaphore is fair (#​3693)
  • sync: improve doc on blocking mutex (#​3645)

v1.4.0: Tokio v1.4.0

Compare Source

Added
  • macros: introduce biased argument for select! (#​3603)
  • runtime: add Handle::block_on (#​3569)
Fixed
  • runtime: avoid unnecessary polling of block_on future (#​3582)
  • runtime: fix memory leak/growth when creating many runtimes (#​3564)
  • runtime: mark EnterGuard with must_use (#​3609)
Documented
  • chore: mention fix for building docs in contributing guide (#​3618)
  • doc: add link to PollSender (#​3613)
  • doc: alias sleep to delay (#​3604)
  • sync: improve Mutex FIFO explanation (#​3615)
  • timer: fix double newline in module docs (#​3617)

v1.3.0: Tokio v1.3.0

Compare Source

Added
  • coop: expose an unconstrained() opt-out (#​3547)
  • net: add into_std for net types without it (#​3509)
  • sync: add same_channel method to mpsc::Sender (#​3532)
  • sync: add {try_,}acquire_many_owned to Semaphore (#​3535)
  • sync: add back RwLockWriteGuard::map and RwLockWriteGuard::try_map (#​3348)
Fixed
  • sync: allow oneshot::Receiver::close after successful try_recv (#​3552)
  • time: do not panic on timeout(Duration::MAX) (#​3551)
Documented
  • doc: doc aliases for pre-1.0 function names (#​3523)
  • io: fix typos (#​3541)
  • io: note the EOF behaviour of read_until (#​3536)
  • io: update AsyncRead::poll_read doc (#​3557)
  • net: update UdpSocket splitting doc (#​3517)
  • runtime: add link to LocalSet on new_current_thread (#​3508)
  • runtime: update documentation of thread limits (#​3527)
  • sync: do not recommend join_all for Barrier (#​3514)
  • sync: documentation for oneshot (#​3592)
  • sync: rename notify to notify_one (#​3526)
  • time: fix typo in Sleep doc (#​3515)
  • time: sync interval.rs and time/mod.rs docs (#​3533)

v1.2.0: Tokio v1.2.0

Compare Source

Added
  • signal: make Signal::poll_recv method public (#​3383)
Fixed
  • time: make test-util paused time fully deterministic (#​3492)
Documented
  • sync: link to new broadcast and watch wrappers (#​3504)

v1.1.1: Tokio v1.1.1

Compare Source

Forward ports 1.0.3 fix.

Fixed
  • io: memory leak during shutdown (#​3477).

v1.1.0: Tokio v1.1.0

Compare Source

Added
  • net: add try_read_buf and try_recv_buf (#​3351)
  • mpsc: Add Sender::try_reserve function (#​3418)
  • sync: add RwLock try_read and try_write methods (#​3400)
  • io: add ReadBuf::inner_mut (#​3443)
Changed
  • macros: improve select! error message (#​3352)
  • io: keep track of initialized bytes in read_to_end (#​3426)
  • runtime: consolidate errors for context missing (#​3441)
Fixed
  • task: wake LocalSet on spawn_local (#​3369)
  • sync: fix panic in broadcast::Receiver drop (#​3434)
Documented
  • stream: link to new Stream wrappers in tokio-stream (#​3343)
  • docs: mention that test-util feature is not enabled with full (#​3397)
  • process: add documentation to process::Child fields (#​3437)
  • io: clarify AsyncFd docs about changes of the inner fd (#​3430)
  • net: update datagram docs on splitting (#​3448)
  • time: document that Sleep is not Unpin (#​3457)
  • sync: add link to PollSemaphore (#​3456)
  • task: add LocalSet example (#​3438)
  • sync: improve bounded mpsc documentation (#​3458)

v1.0.3: Tokio v1.0.3

Compare Source

Fixed
  • io: memory leak during shutdown (#​3477).

v1.0.2: Tokio v1.0.2

Compare Source

Fixed
  • io: soundness in read_to_end (#​3428).

v1.0.1: Tokio v1.0.1

Compare Source

This release fixes a soundness hole caused by the combination of RwLockWriteGuard::map and RwLockWriteGuard::downgrade by removing the map function. This is a breaking change, but breaking changes are allowed under our semver policy when they are required to fix a soundness hole. (See this RFC for more.)

Note that we have chosen not to do a deprecation cycle or similar because Tokio 1.0.0 was released two days ago, and therefore the impact should be minimal.

Due to the soundness hole, we have also yanked Tokio version 1.0.0.

Removed
  • sync: remove RwLockWriteGuard::map and RwLockWriteGuard::try_map (#​3345)
Fixed
  • docs: remove stream feature from docs (#​3335)

v1.0.0: Tokio v1.0.0

Compare Source

Commit to the API and long-term support.

Announcement and more details.

Fixed
  • sync: spurious wakeup in watch (#​3234).
Changed
  • io: rename AsyncFd::with_io() to try_io() (#​3306)
  • fs: avoid OS specific *Ext traits in favor of conditionally defining the fn (#​3264).
  • fs: Sleep is !Unpin (#​3278).
  • net: pass SocketAddr by value (#​3125).
  • net: TcpStream::poll_peek takes ReadBuf (#​3259).
  • rt: rename runtime::Builder::max_threads() to max_blocking_threads() (#​3287).
  • time: require current_thread runtime when calling time::pause() (#​3289).
Removed
  • remove tokio::prelude (#​3299).
  • io: remove AsyncFd::with_poll() (#​3306).
  • net: remove {Tcp,Unix}Stream::shutdown() in favor of AsyncWrite::shutdown() (#​3298).
  • stream: move all stream utilities to tokio-stream until Stream is added to
    std (#​3277).
  • sync: mpsc try_recv() due to unexpected behavior (#​3263).
  • tracing: make unstable as tracing-core is not 1.0 yet (#​3266).
Added
  • fs: poll_* fns to DirEntry (#​3308).
  • io: poll_* fns to io::Lines, io::Split (#​3308).
  • io: _mut method variants to AsyncFd (#​3304).
  • net: poll_* fns to UnixDatagram (#​3223).
  • net: UnixStream readiness and non-blocking ops (#​3246).
  • sync: UnboundedReceiver::blocking_recv() (#​3262).
  • sync: watch::Sender::borrow() (#​3269).
  • sync: Semaphore::close() (#​3065).
  • sync: poll_recv fns to mpsc::Receiver, mpsc::UnboundedReceiver (#​3308).
  • time: poll_tick fn to time::Interval (#​3316).

v0.3.7

Compare Source

v0.3.6: Tokio v0.3.6

Compare Source

Released December 14, 2020

Fixed
  • rt: fix deadlock in shutdown (#​3228)
  • rt: fix panic in task abort when off rt (#​3159)
  • sync: make add_permits panic with usize::MAX >> 3 permits (#​3188)
  • time: Fix race condition in timer drop (#​3229)
  • watch: fix spurious wakeup (#​3244)
Added
  • example: add back udp-codec example (#​3205)
  • net: add TcpStream::into_std (#​3189)

v0.3.5: Tokio v0.3.5

Compare Source

Fixed
  • rt: fix shutdown_timeout(0) (#​3196).
  • time: fixed race condition with small sleeps (#​3069).
Added
  • io: AsyncFd::with_interest() (#​3167).
  • signal: CtrlC stream on windows (#​3186).

v0.3.4: Tokio v0.3.4

Compare Source

Fixed
  • stream: StreamMap Default impl bound (#​3093).
  • io: AsyncFd::into_inner() should deregister the FD (#​3104).
Changed
  • meta: parking_lot feature enabled with full (#​3119).
Added
  • io: AsyncWrite vectored writes (#​3149).
  • net: TCP/UDP readiness and non-blocking ops (#​3130, #​2743, #​3138).
  • net: TCP socket option (linger, send/recv buf size) (#​3145, #​3143).
  • net: PID field in UCred with solaris/illumos (#​3085).
  • rt: runtime::Handle allows spawning onto a runtime (#​3079).
  • sync: Notify::notify_waiters() (#​3098).
  • sync: acquire_many(), try_acquire_many() to Semaphore (#​3067).

v0.3.3: Tokio v0.3.3

Compare Source

Fixes a soundness hole by adding a missing Send bound to Runtime::spawn_blocking().

Fixed
  • rt: include missing Send, fixing soundness hole (#​3089).
  • tracing: avoid huge trace span names (#​3074).
Added
  • net: TcpSocket::reuseport(), TcpSocket::set_reuseport() (#​3083).
  • net: TcpSocket::reuseaddr() (#​3093).
  • net: TcpSocket::local_addr() (#​3093).
  • net: add pid to UCred (#​2633).

v0.3.2: Tokio v0.3.2

Compare Source

Adds AsyncFd as a replacement for v0.2's PollEvented.

Fixed
  • io: fix a potential deadlock when shutting down the I/O driver (#​2903).
  • sync: RwLockWriteGuard::downgrade() bug (#​2957).
Added
  • io: AsyncFd for receiving readiness events on raw FDs (#​2903).
  • net: poll_* function on UdpSocket (#​2981).
  • net: UdpSocket::take_error() (#​3051).
  • sync: oneshot::Sender::poll_closed() (#​3032).

v0.3.1: Tokio v0.3.1

Compare Source

This release fixes a use-after-free in the IO driver. Additionally, the read_buf
and write_buf methods have been added back to the IO traits, as the bytes crate
is now on track to reach version 1.0 together with Tokio.

Fixed
  • net: fix use-after-free (#​3019).
  • fs: ensure buffered data is written on shutdown (#​3009).
Added
  • io: copy_buf() (#​2884).
  • io: AsyncReadExt::read_buf(), AsyncReadExt::write_buf() for working with
    Buf/BufMut (#​3003).
  • rt: Runtime::spawn_blocking() (#​2980).
  • sync: watch::Sender::is_closed() (#​2991).

v0.3.0: Tokio v0.3.0

Compare Source

This represents a 1.0 beta release. APIs are polished and future-proofed. APIs not included for 1.0 stabilization have been removed.

Biggest changes are:

  • I/O driver internal rewrite. The windows implementation includes significant
    changes.
  • Runtime API is polished, especially with how it interacts with feature flag
    combinations.
  • Feature flags are simplified
    • rt-core and rt-util are combined to rt
    • rt-threaded is renamed to rt-multi-thread to match builder API
    • tcp, udp, uds, dns are combied to net.
    • parking_lot is included with full
Changes
  • meta: Minimum supported Rust version is now 1.45.
  • io: AsyncRead trait now takes ReadBuf in order to safely handle reading
    into uninitialized memory (#​2758).
  • io: Internal I/O driver storage is now able to compact (#​2757).
  • rt: Runtime::block_on now takes &self (#​2782).
  • sync: watch reworked to decouple receiving a change notification from
    receiving the value (#​2814, #​2806).
  • sync: Notify::notify is renamed to notify_one (#​2822).
  • process: Child::kill is now an async fn that cleans zombies (#​2823).
  • sync: use const fn constructors as possible (#​2833, #​2790)
  • signal: reduce cross-thread notification (#​2835).
  • net: tcp,udp,uds types support operations with &self (#​2828, #​2919, #​2934).
  • sync: blocking mpsc channel supports send with &self (#​2861).
  • time: rename delay_for and delay_until to sleep and sleep_until (#​2826).
  • io: upgrade to mio 0.7 (#​2893).
  • io: AsyncSeek trait is tweaked (#​2885).
  • fs: File operations take &self (#​2930).
  • rt: runtime API, and #[tokio::main] macro polish (#​2876)
  • rt: Runtime::enter uses an RAII guard instead of a closure (#​2954).
  • net: the from_std function on all sockets no longer sets socket into non-blocking mode (#​2893)
Added
  • sync: map function to lock guards (#​2445).
  • sync: blocking_recv and blocking_send fns to mpsc for use outside of Tokio (#​2685).
  • rt: Builder::thread_name_fn for configuring thread names (#​1921).
  • fs: impl FromRawFd and FromRawHandle for File (#​2792).
  • process: Child::wait and Child::try_wait (#​2796).
  • rt: support configuring thread keep-alive duration (#​2809).
  • rt: task::JoinHandle::abort forcibly cancels a spawned task (#​2474).
  • sync: RwLock write guard to read guard downgrading (#​2733).
  • net: add poll_* functions that take &self to all net types (#​2845)
  • sync: get_mut() for Mutex, RwLock (#​2856).
  • sync: mpsc::Sender::closed() waits for Receiver half to close (#​2840).
  • sync: mpsc::Sender::is_closed() returns true if Receiver half is closed (#​2726).
  • stream: iter and iter_mut to StreamMap (#​2890).
  • net: implement AsRawSocket on windows (#​2911).
  • net: TcpSocket creates a socket without binding or listening (#​2920).
Removed
  • io: vectored ops are removed from AsyncRead, AsyncWrite traits (#​2882).
  • io: mio is removed from the public API. PollEvented and Registration are
    removed (#​2893).
  • io: remove bytes from public API. Buf and BufMut implementation are
    removed (#​2908).
  • time: DelayQueue is moved to tokio-util (#​2897).
Fixed
  • io: stdout and stderr buffering on windows (#​2734).

v0.2.25

Compare Source

v0.2.24

Compare Source

v0.2.23: Tokio v0.2.23

Compare Source

Maintenance release.

Fixes
  • time: report correct error for timers that exceed max duration (#​2023)
  • time: fix resetting expired timers causing panics (#​2587)
  • macros: silence unreachable_code warning in select! (#​2678)
  • rt: fix potential leak during runtime shutdown (#​2649)
  • sync: fix missing notification during mpsc close (#​2854)
Changes
  • io: always re-export std::io (#​2606)
  • dependencies: update parking_lot dependency to 0.11.0 (#​2676)
  • io: rewrite read_to_end and read_to_string (#​2560)
  • coop: reset coop budget when blocking in block_on (#​2711)
  • sync: better Debug for Mutex (#​2725)
  • net: make UnixListener::poll_accept public (#​2880)
  • dep: raise lazy_static to 1.4.0 (#​3132)
  • dep: raise slab to 0.4.2 (#​3132)
Added
  • io: add io::duplex() as bidirectional reader/writer (#​2661)
  • net: introduce split and into_split on UnixDatagram (#​2557)
  • net: ensure that unix sockets have both split and into_split (#​2687)
  • net: add try_recv/from & try_send/to to UnixDatagram (#​1677)
  • net: Add UdpSocket::{try_send,try_send_to} methods (#​1979)
  • net: implement ToSocketAddrs for (String, u16) (#​2724)
  • io: add ReaderStream (#​2714)
  • sync: implement map methods (#​2771)

v0.2.22: Tokio v0.2.22

Compare Source

This release introduces initial support for [tracing][tracing] instrumentation within the Tokio
runtime, enabled by the "tracing" feature flag. In addition, it contains a number of bug
fixes and API additions.

Fixes
Changes
  • coop: returning Poll::Pending no longer decrements the task budget (#​2549)
Added
  • io: little-endian variants of AsyncReadExt and AsyncWriteExt methods
    (#​1915)
  • task: add [tracing][tracing] instrumentation to spawned tasks (#​2655)
  • sync: allow unsized types in Mutex and RwLock (via default constructors)
    (#​2615)
  • net: add ToSocketAddrs implementation for &[SocketAddr] (#​2604)
  • fs: add OpenOptionsExt for OpenOptions (#​2515)
  • fs: add DirBuilder (#​2524)

Signed-off-by: Eliza Weisman [email protected]

v0.2.21: Tokio v0.2.21

Compare Source

Bug fixes and API polish.

Fixes
  • macros: disambiguate built-in #[test] attribute in macro expansion (#​2503)
  • rt: LocalSet and task budgeting (#​2462).
  • rt: task budgeting with block_in_place (#​2502).
  • sync: release broadcast channel memory without sending a value (#​2509).
  • time: notify when resetting a Delay to a time in the past (#​2290).
Added
  • io: get_mut, get_ref, and into_inner to Lines (#​2450).
  • io: mio::Ready argument to PollEvented (#​2419).
  • os: illumos support (#​2486).
  • rt: Handle::spawn_blocking (#​2501).
  • sync: OwnedMutexGuard for Arc<Mutex<T>> (#​2455).

v0.2.20: Tokio v0.2.20

Compare Source

Fixes
  • sync: broadcast closing the channel no longer requires capacity (#​2448).
  • rt: regression when configuring runtime with max_threads less than the number of CPUs (#​2457).

v0.2.19: Tokio v0.2.19

Compare Source

Fixes
Added

v0.2.18: Tokio v0.2.18

Compare Source

Fixes a regression with LocalSet that allowed !Send futures to cross threads.

This change makes LocalSet !Send. The Send implementation was accidentally added in v0.2.14. Removing the Send implementation is not considered a breaking change as it fixes a soundness bug and the implementation was accidental.

Fixes
  • task: LocalSet was incorrectly marked as Send (#​2398)
  • io: correctly report WriteZero failure in write_int (#​2334)

v0.2.17: Tokio 0.2.17

Compare Source

This release fixes a bug in the threaded scheduler that could result in panics under load (see #​2382). Additionally, the default number of worker threads now uses the logical CPU count, so it will now respect scheduler affinity and cgroups CPU quotas.

Fixes
  • rt: bug in work-stealing queue (#​2387)
Changes
  • rt: threadpool uses logical CPU count instead of physical by default (#​2391)

v0.2.16: Tokio 0.2.16

Compare Source

This release fixes a regression in tokio::sync and a bug in tokio::fs::copy. It also
adds a new APIs to tokio::time and tokio::io.

Fixes
  • sync: fix a regression where Mutex, Semaphore, and RwLock futures no
    longer implement Sync (#​2375)
  • fs: fix fs::copy not copying file permissions (#​2354)
Added
  • time: added deadline method to delay_queue::Expired (#​2300)
  • io: added StreamReader (#​2052)

v0.2.15: Tokio v0.2.15

Compare Source

Fixes a queue regression and adds a new disarm fn to mpsc::Sender.

Fixes
Added
  • sync: Add disarm to mpsc::Sender (#​2358).

v0.2.14: Tokio v0.2.14

Compare Source

This release introduces automatic cooperative task yielding. This article describes the new functionality in more detail.

Fixes
  • rt: concurrency bug in scheduler (#​2273).
  • rt: concurrency bug with shell runtime (#​2333).
  • test-util: correct pause/resume of time (#​2253).
  • time: DelayQueue correct wakeup after insert (#​2285).
Added
Changed
  • sync: semaphore, mutex internals rewritten to avoid allocations (#​2325).

v0.2.13: Tokio v0.2.13

Compare Source

Fixes a minor bug in the previous release that resulted in compilation errors using the new pin! form.

Fixes
  • macros: unresolved import in pin! (#​2281).

v0.2.12: Tokio v0.2.12

Compare Source

Polish, small additions, and fixes. The biggest additions in this release are StreamMap and Notify.

StreamMap

Similar to StreamExt::merge, StreamMap supports merging multiple source streams into a single stream, producing items as they become available in the source streams. However, StreamMap supports inserting and removing streams at run-time. This is useful for cases where a consumer wishes to subscribe to messages from multiple sources and dynamically manage those subscriptions.

As the name implies, StreamMap maps keys to streams. Streams are [inserted] or [removed] as needed and then the StreamMap is used as any other stream. Items are returned with their keys, enabling the caller to identify which source stream the item originated from.

Example
use tokio::stream::{StreamExt, StreamMap};
use tokio::sync::mpsc;

#[tokio::main]
async fn main() {
    let (mut tx1, rx1) = mpsc::channel(10);
    let (mut tx2, rx2) = mpsc::channel(10);
    // use `Sender` handles

    let mut map = StreamMap::new();

    // Insert both streams
    map.insert("one", rx1);
    map.insert("two", rx2);

    // Read twice
    for _ in 0..2 {
        let (key, val) = map.next().await.unwrap();

        println!("got {} from {}", val, key);

        // Remove the stream to prevent reading the next value
        map.remove(key);
    }
}
Notify

Notify is the next step in providing async / await based synchronization primitives. It is similar to how thread::park() / unpark() work, but for asynchronous tasks. Consumers await notifications and producers notify consumers. Notify is intended to be used as a building block for higher level synchronization primitives, such as channels.

Examples

Basic usage.

use tokio::sync::Notify;
use std::sync::Arc;

#[tokio::main]
async fn main() {
    let notify = Arc::new(Notify::new());
    let notify2 = notify.clone();

    tokio::spawn(async move {
        notify2.notified().await;
        println!("received notification");
    });

    println!("sending notification");
    notify.notify();
}

Here is how Notify can be used as a building block for an unbounded channel.

use tokio::sync::Notify;

use std::collections::VecDeque;
use std::sync::Mutex;

struct Channel<T> {
    values: Mutex<VecDeque<T>>,
    notify: Notify,
}

impl<T> Channel<T> {
    pub fn send(&self, value: T) {
        self.values.lock().unwrap()
            .push_back(value);

        // Notify the consumer a value is available
        self.notify.notify();
    }

    pub async fn recv(&self) -> T {
        loop {
            // Drain values
            if let Some(value) = self.values.lock().unwrap().pop_front() {
                return value;
            }

            // Wait for values to be available
            self.notify.notified().await;
        }
    }
}
Changes
Fixes
  • net: UnixStream::poll_shutdown should call shutdown(Write) (#​2245).
  • process: Wake up read and write on EPOLLERR (#​2218).
  • rt: potential deadlock when using block_in_place and shutting down the
    runtime (#​2119).
  • rt: only detect number of CPUs if core_threads not specified (#​2238).
  • sync: reduce watch::Receiver struct size (#​2191).
  • time: succeed when setting delay of $MAX-1 (#​2184).
  • time: avoid having to poll DelayQueue after inserting new delay (#​2217).
Added
  • macros: pin! variant that assigns to identifier and pins (#​2274).
  • net: impl Stream for Listener types (#​2275).
  • rt: Runtime::shutdown_timeout waits for runtime to shutdown for specified
    duration (#​2186).
  • stream: StreamMap merges streams and can insert / remove streams at
    runtime (#​2185).
  • stream: StreamExt::skip() skips a fixed number of items (#​2204).
  • stream: StreamExt::skip_while() skips items based on a predicate (#​2205).
  • sync: Notify provides basic async / await task notification (#​2210).
  • sync: Mutex::into_inner retrieves guarded data (#​2250).
  • sync: mpsc::Sender::send_timeout sends, waiting for up to specified duration
    for channel capacity (#​2227).
  • time: impl Ord and Hash for Instant (#​2239).

v0.2.11: Tokio v0.2.11

Compare Source

Introduces [select!][select!], [join!][join!], and [try_join!][try_join!] macros for waiting on multiple async operations concurrently from the same task. These macros are implemented primarily as declarative macros, which works around the recursion limit issue. The select! macro works with any type that implements Future and does not require special `FusedFut


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate
Copy link
Contributor Author

renovate bot commented Mar 22, 2023

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

Warning: custom changes will be lost.

@renovate renovate bot changed the title Update Rust crate tokio to v1 [SECURITY] Update Rust crate tokio to v1 [SECURITY] - abandoned Jun 13, 2023
@renovate
Copy link
Contributor Author

renovate bot commented Jun 13, 2023

Autoclosing Skipped

This PR has been flagged for autoclosing. However, it is being skipped due to the branch being already modified. Please close/delete it manually or report a bug if you think this is in error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants