io: fix memory leak during shutdown (#3477)

In some cases, a cycle is created between I/O driver wakers and the I/O
driver resource slab. This patch clears stored wakers when an I/O
resource is dropped, breaking the cycle.

Fixes #3228
This commit is contained in:
Carl Lerche
2021-01-28 17:49:10 -08:00
committed by GitHub
parent 5d35c907f6
commit 5d0a81fb91
8 changed files with 81 additions and 5 deletions
+23
View File
@@ -28,6 +28,7 @@ jobs:
- clippy
- docs
- loom
- valgrind
steps:
- run: exit 0
@@ -67,6 +68,28 @@ jobs:
run: cargo hack test --each-feature
working-directory: tests-build
valgrind:
name: valgrind
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
run: rustup update stable
- name: Install Valgrind
run: |
sudo apt-get update -y
sudo apt-get install -y valgrind
# Compile tests
- name: cargo build
run: cargo build --features rt-net --bin test-mem
working-directory: tests-integration
# Run with valgrind
- name: Run valgrind
run: valgrind --leak-check=full --show-leak-kinds=all ./target/debug/test-mem
test-unstable:
name: test tokio full --unstable
runs-on: ${{ matrix.os }}