test(daemon): 100K session BGID leak stress (#2297)#4373
Merged
Conversation
fc1e1f6 to
c0cd567
Compare
Adds a long-running stress test that exercises 100,000 sequential mock daemon session lifecycles against fast_io::BgidAllocator. Each cycle acquires a buffer-group id and immediately returns it on drop, modelling a long-lived daemon that cycles through many short transfers. Asserts: - in-flight bgid count returns to zero after every cycle; - peak occupancy stays bounded under 1,024 (without recycling, peak would track allocation count and hit BgidExhausted at ~65K); - free-list reuse dominates fresh minting by >= 10x. Gated on cfg(all(target_os = "linux", feature = "io_uring")) and on OC_RSYNC_BGID_STRESS=1 so the default test budget stays fast.
c0cd567 to
6a4f055
Compare
oferchen
added a commit
that referenced
this pull request
May 18, 2026
* test(daemon): 100K session BGID leak stress (#2297) Adds a long-running stress test that exercises 100,000 sequential mock daemon session lifecycles against fast_io::BgidAllocator. Each cycle acquires a buffer-group id and immediately returns it on drop, modelling a long-lived daemon that cycles through many short transfers. Asserts: - in-flight bgid count returns to zero after every cycle; - peak occupancy stays bounded under 1,024 (without recycling, peak would track allocation count and hit BgidExhausted at ~65K); - free-list reuse dominates fresh minting by >= 10x. Gated on cfg(all(target_os = "linux", feature = "io_uring")) and on OC_RSYNC_BGID_STRESS=1 so the default test budget stays fast. * chore: refresh Cargo.lock
oferchen
added a commit
that referenced
this pull request
May 18, 2026
* test(daemon): 100K session BGID leak stress (#2297) Adds a long-running stress test that exercises 100,000 sequential mock daemon session lifecycles against fast_io::BgidAllocator. Each cycle acquires a buffer-group id and immediately returns it on drop, modelling a long-lived daemon that cycles through many short transfers. Asserts: - in-flight bgid count returns to zero after every cycle; - peak occupancy stays bounded under 1,024 (without recycling, peak would track allocation count and hit BgidExhausted at ~65K); - free-list reuse dominates fresh minting by >= 10x. Gated on cfg(all(target_os = "linux", feature = "io_uring")) and on OC_RSYNC_BGID_STRESS=1 so the default test budget stays fast. * chore: refresh Cargo.lock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
crates/daemon/tests/bgid_long_running_stress.rs: a 100,000-cycle stress test that exercisesfast_io::BgidAllocatorthrough mock daemon session lifecycles (acquire bgid, drop, repeat).cfg(all(target_os = "linux", feature = "io_uring"))plusOC_RSYNC_BGID_STRESS=1so the default test budget is untouched; skipped cleanly with a one-line message when the env var is unset.fast_ioin as a Linux-only dev-dependency ofdaemon.Closes #2297. Follows BGE-3 (#4355) and pairs with the upcoming BGE-4 (#4362) observability counters.
Test plan
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features --no-deps -- -D warningscargo nextest run -p daemon --test bgid_long_running_stress --all-features(skips without env var)OC_RSYNC_BGID_STRESS=1 cargo nextest run -p daemon --test bgid_long_running_stress --all-featureson a Linux host with io_uring (full 100K run)