8000 fix: deadlock by MrCroxx · Pull Request #43 · foyer-rs/foyer · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: deadlock #43

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

Merged
merged 2 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions .github/template/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,37 @@ jobs:
run: |
cargo llvm-cov nextest --lcov --output-path lcov.info
- uses: codecov/codecov-action@v2
deadlock:
name: run with single worker thread and deadlock detection
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install rust toolchain@v1
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
# components: rustfmt, clippy, llvm-tools-preview
- name: Cache Cargo home
uses: actions/cache@v2
id: cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-asan-${{ hashFiles('**/Cargo.lock') }}-${{ env.CACHE_KEY_SUFFIX }}
- name: Run foyer-storage-bench with single worker thread and deadlock detection
env:
RUST_BACKTRACE: 1
RUSTFLAGS: '--cfg tokio_unstable'
RUST_LOG: info
TOKIO_WORKER_THREADS: 1
run: |-
cargo build --all --features deadlock &&
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench/deadlock &&
timeout 2m ./target/debug/foyer-storage-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench/deadlock --capacity 256 --region-size 16 --buffer-pool-size 256 --lookup-range 1000 --time 60
asan:
name: run with address saniziter
runs-on: ubuntu-latest
Expand All @@ -95,8 +126,8 @@ jobs:
env:
RUST_BACKTRACE: 1
RUSTFLAGS: '-Zsanitizer=address --cfg tokio_unstable'
EXTRA_CARGO_ARGS: '--verbose -Zbuild-std --target x86_64-unknown-linux-gnu'
RUST_LOG: info
run: |-
cargo build --all --target x86_64-unknown-linux-gnu &&
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench &&
./target/x86_64-unknown-linux-gnu/debug/foyer-storage-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench --capacity 256 --region-size 16 --buffer-pool-size 256 --lookup-range 1000
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench/asan &&
timeout 2m ./target/x86_64-unknown-linux-gnu/debug/foyer-storage-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench/asan --capacity 256 --region-size 16 --buffer-pool-size 256 --lookup-range 1000 --time 60
36 changes: 33 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,36 @@ jobs:
run: |
cargo llvm-cov nextest --lcov --output-path lcov.info
- uses: codecov/codecov-action@v2
deadlock:
name: run with single worker thread and deadlock detection
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install rust toolchain@v1
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: Cache Cargo home
uses: actions/cache@v2
id: cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-asan-${{ hashFiles('**/Cargo.lock') }}-${{ env.CACHE_KEY_SUFFIX }}
- name: Run foyer-storage-bench with single worker thread and deadlock detection
env:
RUST_BACKTRACE: 1
RUSTFLAGS: '--cfg tokio_unstable'
RUST_LOG: info
TOKIO_WORKER_THREADS: 1
run: |-
cargo build --all --features deadlock &&
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench/deadlock &&
timeout 2m ./target/debug/foyer-storage-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench/deadlock --capacity 256 --region-size 16 --buffer-pool-size 256 --lookup-range 1000 --time 60
asan:
name: run with address saniziter
runs-on: ubuntu-latest
Expand All @@ -101,11 +131,11 @@ jobs:
env:
RUST_BACKTRACE: 1
RUSTFLAGS: '-Zsanitizer=address --cfg tokio_unstable'
EXTRA_CARGO_ARGS: '--verbose -Zbuild-std --target x86_64-unknown-linux-gnu'
RUST_LOG: info
run: |-
cargo build --all --target x86_64-unknown-linux-gnu &&
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench &&
./target/x86_64-unknown-linux-gnu/debug/foyer-storage-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench --capacity 256 --region-size 16 --buffer-pool-size 256 --lookup-range 1000
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench/asan &&
timeout 2m ./target/x86_64-unknown-linux-gnu/debug/foyer-storage-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench/asan --capacity 256 --region-size 16 --buffer-pool-size 256 --lookup-range 1000 --time 60

# ================= THIS FILE IS AUTOMATICALLY GENERATED =================
#
Expand Down
36 changes: 33 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,36 @@ jobs:
run: |
cargo llvm-cov nextest --lcov --output-path lcov.info
- uses: codecov/codecov-action@v2
deadlock:
name: run with single worker thread and deadlock detection
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install rust toolchain@v1
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: Cache Cargo home
uses: actions/cache@v2
id: cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-asan-${{ hashFiles('**/Cargo.lock') }}-${{ env.CACHE_KEY_SUFFIX }}
- name: Run foyer-storage-bench with single worker thread and deadlock detection
env:
RUST_BACKTRACE: 1
RUSTFLAGS: '--cfg tokio_unstable'
RUST_LOG: info
TOKIO_WORKER_THREADS: 1
run: |-
cargo build --all --features deadlock &&
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench/deadlock &&
timeout 2m ./target/debug/foyer-storage-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench/deadlock --capacity 256 --region-size 16 --buffer-pool-size 256 --lookup-range 1000 --time 60
asan:
name: run with address saniziter
runs-on: ubuntu-latest
Expand All @@ -100,11 +130,11 @@ jobs:
env:
RUST_BACKTRACE: 1
RUSTFLAGS: '-Zsanitizer=address --cfg tokio_unstable'
EXTRA_CARGO_ARGS: '--verbose -Zbuild-std --target x86_64-unknown-linux-gnu'
RUST_LOG: info
run: |-
cargo build --all --target x86_64-unknown-linux-gnu &&
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench &&
./target/x86_64-unknown-linux-gnu/debug/foyer-storage-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench --capacity 256 --region-size 16 --buffer-pool-size 256 --lookup-range 1000
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench/asan &&
timeout 2m ./target/x86_64-unknown-linux-gnu/debug/foyer-storage-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench/asan --capacity 256 --region-size 16 --buffer-pool-size 256 --lookup-range 1000 --time 60
concurrency:
group: environment-${{ github.ref }}
cancel-in-progress: true
Expand Down
Loading
0