- Notifications
You must be signed in to change notification settings - Fork1.6k
Tags: bytecodealliance/wasmtime
Tags
dev
fix `Pollable` impl for `OutgoingDatagramStream` (#12629)* fix `Pollable` impl for `OutgoingDatagramStream`Previously, `OutgoingDatagramStream` used its `send_state` field to determinewhether the socket was ready for writing without necessarily polling the`tokio::net::UdpSocket`. The underlying assumption was that a freshly-boundsocket would be immediately ready for writing, but that's not true for `tokio`.`tokio` assumes a socket is not ready for _anything_ by default and relies one.g. `epoll` to tell it otherwise.In practice, this meant the `Pollable::ready` impl for `OutgoingDatagramStream`would resolve immediately for a fresh socket, leaving the guest to race with`tokio`'s use of `epoll`. Usually, `tokio` won and all was well, butoccasionally it lost and the `OutgoingDatagramStream::send` call would return`Ok(0)` (meaning "would block") leaving the guest confused since it was justtold that the socket was ready for writing.This commit removes `SendState` entirely, relying exclusively on`tokio::net::UdpSocket::ready` for the `Pollable` and `check_send`implementations. As a side effect, we no longer attempt to prevent the guestfrom sending more datagrams than `check_send` indicated since the numberreturned by `check_send` is only a guess anyway, and `tokio` will push back ifit needs to. For `p3`, the whole `check_send`/`send` pattern is gone, so wewon't need to concern ourselves with it going forward.Fixes#12612* address review feedback
v41.0.2
Release Wasmtime 41.0.2 (#12499)* Release Wasmtime 41.0.2[automatically-tag-and-release-this-commit]* Add release notes* Pin wkg version---------Co-authored-by: Wasmtime Publish <wasmtime-publish@users.noreply.github.com>Co-authored-by: Alex Crichton <alex@alexcrichton.com>
PreviousNext