[🐛 BUG]: Streaming responses can experience a lock-up when the client disconnects early #1830
Closed
1 task done
Labels
B-bug
Bug: bug, exception
B-regression
Bug: regression bugs
Y-Release blocker
Priority: Release blocker
Milestone
No duplicates 🥲.
What happened?
When a browser disconnects early while receiving a response streamed from PHP, the worker / PHP can lock up.
The worker never recovers by itself
The chunk size heavily effects the chance of this occurring (eg. 512000 bytes is likely to lockup first try, where as 512 bytes could take 100s of attempts, and 51200 bytes will lockup within a few)
This is a dump of the last ~100 executed PHP functions/class methods executed by the php process, the final instruction is where the process is left stuck: fwrite(Unknown Type, '', 51216)
This is execution of "Spiral\RoadRunner\Http\HttpWorker::respondStream" (first instruction here is line 125: $body->next();)
Version (rr --version)
2023.3.8 (build time: 2023-12-14T16:05:26+0000, go1.21.5), OS: linux, arch: amd64
How to reproduce the issue?
The worker.php below is almost identical to the example provided in the documentation, except its reading from a large (5gb) file (DIR . '/IMG_0192.MOV') -- size only important to the point of giving you enough time to cancel
rr.yaml
worker.php
Relevant log output
The text was updated successfully, but these errors were encountered: