fix: close Node listeners during graceful shutdown - #1743
Conversation
|
Warning Review limit reached
Next review available in: 37 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. 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: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
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 |
📊 Benchmark Results✅ All benchmarks passed
Updated: 2026-08-04T09:32:32.542Z · Commit: 283efc5 |
Outcome
Signal-driven shutdown failures are now observed exactly once, logged safely even when the configured logger fails, and reflected through a nonzero process exit code instead of becoming unhandled rejections.
Node servers created by
CrocoApp.listen()are bound to configured graceful-shutdown middleware. Shutdown rejects new work, drains active requests, closes each listener, drains the event bus, and then runs the configured hook. Timeout fallback force-closes retained HTTP connections, while repeated signals and late listeners remain idempotent without interrupting an existing drain.Fixes #1684
Verification
pnpm --filter @croco/framework-context test— 189 passed.pnpm --filter @croco/transports-http test— 400 passed.pnpm public-api:checkandpnpm problem-registry:checkpassed.pnpm check— 24/25 passed, 1 not applicable.Review gates
listen()path, Lambda/fetch semantics and public types are unchanged, failure logs retain structured errors, and patch changesets cover both affected packages.Validation gap
pnpm docs:api:checkstill reports unrelated generated API drift already carried by #1727 (desktop grants, GraphQL policy decorators, and billing conformance types). This PR does not add public API documentation drift.