perf(spiders): non-blocking async file I/O for cache + checkpoint (#32 #34)#54
Conversation
#32/#34: ResponseCache and CheckpointManager performed synchronous std::fs I/O while called from async contexts (cache inside tokio::spawn per request; checkpoint in the main crawl loop), blocking Tokio worker threads. - get/restore now use tokio::fs (async reads). - put/save remain atomic (NamedTempFile::persist) but run on the blocking pool via spawn_blocking, since the temp-file API has no async variant — this keeps the Windows-correct atomic replace without stalling a worker. - cleanup uses tokio::fs::remove_file. - Engine call sites and the cache/checkpoint unit tests updated to .await. Closes #32 Closes #34 https://claude.ai/code/session_012RmdaovmNWZVAim4XxCWwn
|
Warning Review limit reached
More reviews will be available in 37 minutes and 7 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✨ 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. Comment |
Summary
ResponseCacheandCheckpointManagerdid synchronousstd::fsI/O while invoked from async contexts — the cache inside per-requesttokio::spawntasks (#32) and the checkpoint in the main crawl loop (#34) — blocking Tokio worker threads on disk I/O.get/restore→tokio::fsasync reads.put/savekeep the atomicNamedTempFile::persistwrite (Windows-correct, from upstream-sync: atomic writes for checkpoint and dev-cache files #31) but run it on the blocking pool viatokio::task::spawn_blocking, sincetempfilehas no async API. This avoids stalling a worker while preserving atomicity.cleanup→tokio::fs::remove_file..await(#[tokio::test]).Test plan
#[tokio::test]cargo test,clippy --all-targets -D warnings,fmt --checkall greenCloses #32
Closes #34
Generated by Claude Code