Skip to content

test(daemon): 100K session BGID leak stress (#2297)#4373

Merged
oferchen merged 2 commits into
masterfrom
test/bge-100k-session-stress
May 18, 2026
Merged

test(daemon): 100K session BGID leak stress (#2297)#4373
oferchen merged 2 commits into
masterfrom
test/bge-100k-session-stress

Conversation

@oferchen
Copy link
Copy Markdown
Owner

Summary

  • Adds crates/daemon/tests/bgid_long_running_stress.rs: a 100,000-cycle stress test that exercises fast_io::BgidAllocator through mock daemon session lifecycles (acquire bgid, drop, repeat).
  • Validates that the free-list-first recycling policy from feat: reuse io_uring buffer group IDs via free-list #4019 / feat(fast_io): BGID high-water mark + 50%-occupancy warning (#2295) #4355 keeps the 16-bit bgid namespace bounded under heavy churn - peak in-flight stays under 1,024 and reuse outweighs fresh minting by >= 10x.
  • Gated on cfg(all(target_os = "linux", feature = "io_uring")) plus OC_RSYNC_BGID_STRESS=1 so the default test budget is untouched; skipped cleanly with a one-line message when the env var is unset.
  • Wires fast_io in as a Linux-only dev-dependency of daemon.

Closes #2297. Follows BGE-3 (#4355) and pairs with the upcoming BGE-4 (#4362) observability counters.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings
  • cargo 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-features on a Linux host with io_uring (full 100K run)

@github-actions github-actions Bot added the test label May 18, 2026
@oferchen oferchen force-pushed the test/bge-100k-session-stress branch 4 times, most recently from fc1e1f6 to c0cd567 Compare May 18, 2026 01:25
oferchen added 2 commits May 18, 2026 04:29
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.
@oferchen oferchen force-pushed the test/bge-100k-session-stress branch from c0cd567 to 6a4f055 Compare May 18, 2026 01:29
@oferchen oferchen merged commit bbe3533 into master May 18, 2026
4 of 9 checks passed
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
@oferchen oferchen deleted the test/bge-100k-session-stress branch May 19, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant