Changes to ResponseFactory stream has broken streamed responses when using Octane with RoadRunner
Laravel Version
12.18.0
PHP Version
8.4.6
Database Driver & Version
No response
Description
When using Laravel Octane with RoadRunner, the changes done in https://github.com/laravel/framework/commit/a9bfc0d37d1580bdafe39735b12fa8656fb3f24b result in streaming being broken and coming in as one single chunk.
The recent change overrides the Generator and changes returns to echos which does not work for Octane with Roadrunner.
Related: https://github.com/laravel/octane/pull/939
Steps To Reproduce
Set up Laravel with Octane and RoadRunner. Return a streamed response and see that it all comes out as one chunk.
In my opinion, Octane is designed to optimize Laravel for high-performance environments like RoadRunner, the streaming behavior should be handled at the Octane level rather than in the core framework. The current changes in ResponseFactory break the expected behavior for Octane users.
Proposed solution:
-
Revert the ResponseFactory changes to maintain standard streaming behavior
-
Let Octane handle the streaming optimizations for its supported servers (RoadRunner/Swoole)
-
Octane can then implement the most efficient streaming approach for each specific environment
by this we keeps the core framework clean while allowing Octane to optimize streaming responses for its target environments
Hey there, thanks for reporting this issue.
We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?
Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
laravel new bug-report --github="--public"
Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.
Thanks!
Hey there,
We're closing this issue because it's inactive, already solved, old, or not relevant anymore. Feel free to open up a new issue if you're still experiencing this problem.
Sure, no problem. Unfortunately, I have been unable to get around to creating a reproduction, though it should be simple to reproduce, it just keeps going on the back burner.
For those that encounter this issue in the future if it is never fixed. You can get around it by just returning the proper StreamedResponse you would expect manually and stop using Laravels stream method since it has been broken in RR by this change.