feat(node): pooled resource scope#377
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 13 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?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 reviews. How do review 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 refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
"pooled"resource scope — a bounded checkout/return pool per resource, implementing the cross-SDK pooled-resource contract.ResourcePoolwith a private promise-based FIFO semaphore (per-waiter unref'd timeout, waiter removed on timeout so a later permit goes to a live caller). Checkout waits up toacquireTimeoutMs(default 10s) then throws the newResourceUnavailableError; idle instances are reused untilmaxLifetimeMsevicts them;activemoves only after the factory resolves and the permit is returned on factory rejection, so capacity never leaks. Prewarm tops the idle list up topoolMin(idempotent across worker leases) and is best-effort.queue.resource(name, factory, { scope: "pooled", pool: { poolSize, poolMin, acquireTimeoutMs, maxLifetimeMs } });pooloptions without the pooled scope are rejected.created/disposedmetrics move only on actual build/eviction/shutdown.useworker-scoped dependencies — pooled instances outlive tasks (ResourceScopeErrormessage now names both scopes).Test plan
ResourcePoolunit (reuse, timeout, capacity safety, prewarm, lifetime eviction, stats), 5 runtime-level, 4 worker-integration.pnpm typecheck,pnpm lint, full suite 263 tests green; docstypes:check+lintgreen.