fix(index): add MAX_SEARCH_SIZE bounds to prevent OOM#88
Conversation
Clamp size and from in search() to prevent OOM from unbounded result allocation. Add validation in validate_search_request() to fail fast on requests that exceed limits. MAX_SEARCH_SIZE = 10,000 MAX_SEARCH_OFFSET = 1,000,000 Fixes: #83
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 27 minutes and 16 seconds.Comment |
Summary
sizeandfrominsearch()toMAX_SEARCH_SIZE(10,000) andMAX_SEARCH_OFFSET(1,000,000) to prevent OOM from unbounded result allocationvalidate_search_request()to fail fast on requests exceeding limitssize: 100_000_000and exhaust server memoryTest plan
cargo test --package cloudsearch-index— all 84 tests passcargo test --package cloudsearch-api— all 24 tests passcargo clippy --workspace --all-targets -- -D warnings -D clippy::pedantic— clean