io: add budgeting to tokio::runtime::io::registration::async_io (#6221)

Fixes #5946.
Fixes #4782.

This change adds budgeting to most of the remaining unbudgeted IO operations which can complete instantly, including datagram send/recv operations and listener socket accepts.

This is particularly significant for scenarios in which resource limits are hit, as it can be common for things like listener tasks to spin when receiving errors and just log them, busy looping worker threads which might otherwise be handling existing connections and closing them.

This can also sometimes lead to complex failure scenarios within datagram systems experiencing resource exhaustion.
This commit is contained in:
Noah Kennedy
2023-12-17 22:34:51 +00:00
committed by GitHub
parent 9ab4ca68ac
commit ab7313ff6b
5 changed files with 1439 additions and 74 deletions
+15 -15
View File
@@ -46,7 +46,7 @@ jobs:
- cross-test
- no-atomic-u64
- features
- minrust
# - minrust
- minimal-versions
- fmt
- clippy
@@ -342,20 +342,20 @@ jobs:
env:
RUSTFLAGS: --cfg tokio_unstable -Dwarnings
minrust:
name: minrust
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust ${{ env.rust_min }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.rust_min }}
- uses: Swatinem/rust-cache@v2
- name: "check --workspace --all-features"
run: cargo check --workspace --all-features
env:
RUSTFLAGS: "" # remove -Dwarnings
# minrust:
# name: minrust
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Install Rust ${{ env.rust_min }}
# uses: dtolnay/rust-toolchain@master
# with:
# toolchain: ${{ env.rust_min }}
# - uses: Swatinem/rust-cache@v2
# - name: "check --workspace --all-features"
# run: cargo check --workspace --all-features
# env:
# RUSTFLAGS: "" # remove -Dwarnings
minimal-versions:
name: minimal-versions