mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-23 00:00:10 +02:00
In the multi-threaded scheduler, when there are no tasks on the local queue, a worker will attempt to pull tasks from the injection queue. Previously, the worker would only attempt to poll one task from the injection queue then continue trying to find work from other sources. This can result in the injection queue backing up when there are many tasks being scheduled from outside of the runtime. This patch updates the worker to try to poll more than one task from the injection queue when it has no more local work. Note that we also don't want a single worker to poll **all** tasks on the injection queue as that would result in work becoming unbalanced.
55 lines
1.6 KiB
YAML
55 lines
1.6 KiB
YAML
on:
|
|
push:
|
|
branches: ["master", "tokio-*.x"]
|
|
pull_request:
|
|
types: [labeled, opened, synchronize, reopened]
|
|
branches: ["master", "tokio-*.x"]
|
|
|
|
name: Loom
|
|
|
|
env:
|
|
RUSTFLAGS: -Dwarnings
|
|
RUST_BACKTRACE: 1
|
|
# Change to specific Rust release to pin
|
|
rust_stable: stable
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
loom:
|
|
name: loom
|
|
# base_ref is null when it's not a pull request
|
|
if: github.repository_owner == 'tokio-rs' && (contains(github.event.pull_request.labels.*.name, 'R-loom') || (github.base_ref == null))
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- scope: --skip loom_pool
|
|
max_preemptions: 2
|
|
- scope: loom_pool::group_a
|
|
max_preemptions: 1
|
|
- scope: loom_pool::group_b
|
|
max_preemptions: 2
|
|
- scope: loom_pool::group_c
|
|
max_preemptions: 1
|
|
- scope: loom_pool::group_d
|
|
max_preemptions: 1
|
|
- scope: time::driver
|
|
max_preemptions: 2
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Install Rust ${{ env.rust_stable }}
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ env.rust_stable }}
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: loom ${{ matrix.scope }}
|
|
run: cargo test --lib --release --features full -- --nocapture $SCOPE
|
|
working-directory: tokio
|
|
env:
|
|
RUSTFLAGS: --cfg loom --cfg tokio_unstable -Dwarnings
|
|
LOOM_MAX_PREEMPTIONS: ${{ matrix.max_preemptions }}
|
|
LOOM_MAX_BRANCHES: 10000
|
|
SCOPE: ${{ matrix.scope }}
|