Repository navigation
fix: settle closed request bodies and clear rejected-body timers - #8586
DeepanshuPal wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 SummarySummary by CodeRabbit
Walkthrough
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable issue remains; the change is ready to merge after normal checks. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 2 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
createStreamPromise leaves its timeout running when the body exceeds the size limit. It also does not handle a stream that closes before end, so that request waits for the timeout, or never settles when no finite timeout is set.
Clear the timeout on every terminal path and reject premature closure promptly. Mark a normally completed body as closed before resolving it, so the close event after end cannot change the result. Stream ownership and the body-size limit are unchanged.
Tests cover size rejection, early close with and without a timeout, normal chunk collection, stream errors, timeout, and later events after rejection. Two cases fail on unchanged code and all seven pass with the fix. The full unit suite passes (728 tests), along with build, typecheck, and lint/format checks. Integration and end-to-end suites were not run.