Add changelog entry for streaming deadlock fix (#2562)#2564
Add changelog entry for streaming deadlock fix (#2562)#2564AbanoubGhadban merged 2 commits intomasterfrom
Conversation
Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThree Pro-specific fixes were added to the CHANGELOG under Unreleased: fixes for streaming deadlocks and async exception/cache issues on client disconnect, handling HTTPX error responses when fetching dev-server bundles/assets, and streaming SSR hang fixes with safePipe and termination signaling. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Greptile SummaryThis PR adds a single changelog entry for PR #2562 under the
Confidence Score: 5/5
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Client disconnects mid-stream] --> B{Bounded queue full?}
B -- Yes --> C[writing_task deadlock\n❌ Before fix]
B -- Yes --> D[ensure block stops barrier\n✅ After fix]
A --> E[Partial result cached?\n❌ Before fix]
A --> F[on_complete gated on full consumption\nprocess_stream_chunks returns boolean\n✅ After fix]
A --> G[Exception masked in cleanup\n❌ Before fix]
A --> H[$ERROR_INFO captured before ensure\n✅ After fix]
A --> I[Async::Queue::ClosedError unrescued\n❌ Before fix]
A --> J[ClosedError rescued in cache-hit\nenqueue path\n✅ After fix]
Last reviewed commit: 35a76e3 |
|
|
||
| ##### Fixed | ||
|
|
||
| - **Fix streaming deadlock, exception masking, and cache poisoning on client disconnect**: Fixed four async streaming bugs: (1) writing_task no longer deadlocks when the client disconnects mid-stream with a full bounded queue — an `ensure` block now stops the barrier on any writer exit; (2) exception masking is prevented by capturing `$ERROR_INFO` before cleanup in the ensure block; (3) cache poisoning from partial stream results is prevented by gating `on_complete` on full consumption (`process_stream_chunks` returns a boolean); (4) `Async::Queue::ClosedError` is now rescued in the cache-hit enqueue path. Also fixes Redis thread leaks in the dummy app controller. Includes integration tests for client disconnect at small, medium, and large response sizes. [PR 2562](https://github.com/shakacode/react_on_rails/pull/2562) by [AbanoubGhadban](https://github.com/AbanoubGhadban). |
There was a problem hiding this comment.
Two minor nits on this entry:
-
writing_taskshould be backtick-formatted — all other code identifiers in this entry use backticks (`ensure`,`$ERROR_INFO`,`process_stream_chunks`,`Async::Queue::ClosedError`), butwriting_taskis left as plain text. -
Test mention should be omitted — Per the changelog guidelines ([
.claude/docs/changelog-guidelines.md]): "Do NOT add entries for: linting, formatting, refactoring, tests, or documentation fixes." The sentence "Includes integration tests for client disconnect at small, medium, and large response sizes." describes a test addition, not a user-visible change, and should be dropped.
Suggested replacement:
| - **Fix streaming deadlock, exception masking, and cache poisoning on client disconnect**: Fixed four async streaming bugs: (1) writing_task no longer deadlocks when the client disconnects mid-stream with a full bounded queue — an `ensure` block now stops the barrier on any writer exit; (2) exception masking is prevented by capturing `$ERROR_INFO` before cleanup in the ensure block; (3) cache poisoning from partial stream results is prevented by gating `on_complete` on full consumption (`process_stream_chunks` returns a boolean); (4) `Async::Queue::ClosedError` is now rescued in the cache-hit enqueue path. Also fixes Redis thread leaks in the dummy app controller. Includes integration tests for client disconnect at small, medium, and large response sizes. [PR 2562](https://github.com/shakacode/react_on_rails/pull/2562) by [AbanoubGhadban](https://github.com/AbanoubGhadban). | |
| - **Fix streaming deadlock, exception masking, and cache poisoning on client disconnect**: Fixed four async streaming bugs: (1) `writing_task` no longer deadlocks when the client disconnects mid-stream with a full bounded queue — an `ensure` block now stops the barrier on any writer exit; (2) exception masking is prevented by capturing `$ERROR_INFO` before cleanup in the ensure block; (3) cache poisoning from partial stream results is prevented by gating `on_complete` on full consumption (`process_stream_chunks` returns a boolean); (4) `Async::Queue::ClosedError` is now rescued in the cache-hit enqueue path. Also fixes Redis thread leaks in the dummy app controller. [PR 2562](https://github.com/shakacode/react_on_rails/pull/2562) by [AbanoubGhadban](https://github.com/AbanoubGhadban). |
Review: Changelog entry for PR #2562Overall the placement and format are correct — the entry is properly under Two minor issues flagged inline:
A code suggestion with both fixes is on the inline comment. |
Co-Authored-By: Claude Opus 4.6 <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@CHANGELOG.md`:
- Line 42: The changelog contains a duplicate entry for PR 2407 ("Fix streaming
SSR hangs and silent error absorption in RSC payload injection") in the
Unreleased section; remove this duplicate paragraph so the fix only appears
under the 16.4.0.rc.6 release. Locate the paragraph matching PR 2407 / the exact
text about safePipe and Ruby safety net in the Unreleased section and delete it
entirely, leaving the original entry under the 16.4.0.rc.6 release intact and
ensuring PR `#2562`'s intended changelog entry remains as-is.
Review: Changelog Entry for PR #2562This is a clean, correctly-formatted entry placed in the right section. A couple of observations: 1. Missing fourth bug fix PR #2562 fixed four distinct bugs, but the entry only covers three:
2. Less technical detail than surrounding entries Other entries in the same section describe the specific fix mechanism (e.g., PR 2407 mentions Suggested revision: Fix streaming deadlock, exception masking, cache poisoning, and ClosedError on client disconnect: Fixed four async streaming bugs in drain_streams_concurrently/consumer_stream_async: (1) added ensure block calling @async_barrier.stop on writing-task exit so producers cannot block forever on a full queue; (2) captured $ERROR_INFO before cleanup so a secondary writer exception does not mask the root-cause producer exception; (3) changed break to return false in process_stream_chunks and gated on_complete on full stream consumption to prevent caching incomplete HTML; (4) rescued Async::Queue::ClosedError in handle_stream_cache_hit to avoid an unhandled error when enqueuing to an already-closed queue. PR 2562 by AbanoubGhadban. |
|
|
||
| ##### Fixed | ||
|
|
||
| - **Fix streaming deadlock, exception masking, and cache poisoning on client disconnect**: Fixed async streaming bugs where client disconnect could cause deadlocks, mask producer exceptions, or cache partial results. [PR 2562](https://github.com/shakacode/react_on_rails/pull/2562) by [AbanoubGhadban](https://github.com/AbanoubGhadban). |
There was a problem hiding this comment.
The title and description omit one of the four fixes from PR #2562: the Async::Queue::ClosedError rescue added to handle_stream_cache_hit. That fix prevents an unhandled error when a background reader tries to enqueue a cached chunk to a queue that was already closed due to an error in another component.
Also, compared to the neighbouring entries, this description is quite terse — it doesn't mention what was done (e.g. ensure + @async_barrier.stop, return false vs break, gating on_complete). Consider expanding slightly so readers understand the shape of the fix without having to open the PR.
## Summary - Add changelog entries for 6 user-visible PRs merged since v16.4.0.rc.6 that were missing from `[Unreleased]` - Update existing #2561 entry to include #2568 contributor credit ### New entries added | Section | PR | Description | |---|---|---| | Added | #2539 | Environment-variable-driven ports in Procfile templates | | Fixed | #2417 | Rspack generator config path fix | | Fixed | #2419 | Precompile hook load-based execution fix | | Fixed | #2577 | `create-react-on-rails-app` validation improvements | | Pro Fixed | #2416 | StreamResponse status fallback fix | | Pro Fixed | #2566 | Empty-string license plan mismatch fix | ### Skipped PRs (not user-visible) Docs (#2406, #2414, #2479, #2494, #2518, #2537, #2544), CI/internal (#2533, #2547, #2555, #2557, #2558, #2564), dependabot (#2387, #2541), dev dependencies (#2559, #2569, #2573). ## Test plan - [ ] Verify changelog formatting matches existing entries - [ ] Verify all user-visible PRs since v16.4.0.rc.6 are covered 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Documentation-only changelog updates with no runtime or build behavior changes. > > **Overview** > Updates `CHANGELOG.md`’s **[Unreleased]** section to include previously missing user-facing entries: Procfile templates now support env-driven ports, several generator/`bin/dev` precompile-hook and rspack-path fixes are documented, and `create-react-on-rails-app` validation improvements are noted. > > Also adds two Pro fix entries (StreamResponse status fallback and license plan empty-string validation) and updates the existing `bin/dev` precompile-hook entry to credit an additional PR/contributor. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e75d2b5. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude Opus 4.6 <[email protected]>
Summary
#### Pro > ##### Fixedfor PR Fix streaming deadlock, exception masking, and cache poisoning #2562 which fixed streaming deadlock, exception masking, and cache poisoning on client disconnectTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit