Closed ninsuo closed 4 months ago
You don't mention which version: standalone binary, i.e., the one from the downloads page, or the docker image.
One is a static build of PHP that has it's own php.ini, and the other is a more traditional shared lib build that uses the regular docker php.ini.
Regardless, I have a suspicion on the issue; I'll take a look.
I found the issue, and I'm creating a PR.
Thank you @withinboredom , I only tried using Docker.
@withinboredom Any idea when we can get #692 merged? I'm pretty sure it's causing our issues with SSEs in our laravel application on production using the docker container.
Scratch that, I might be experiencing a different problem. It's working locally on my M1 mac using http2, but not on production using http3. (Laravel Octane)
@LukeAbell Indeed, this problem le should only occur when using HTTP/1, not when using 2 or 3.
We're waiting for a new Caddy release to merge #692. The Caddy team is working on it.
@dunglas Got it. Any idea what would cause it to work locally but not on prod using docker? I've confirmed the PHP config is the same. I can open a different ticket if that's better.
To be honest I've no idea. A reproducer would be great!
And yes, please open another issue as this one will be closed when we will merge the current fix, that is unlikely to fix the issue you're describing.
What happened?
Following days of investigations on load-balancing problems, we've found out that SSEs seem not working over HTTP/1 with frankenphp.
Using caddy along with php-fpm works well (wait 30s to get a ping):
But using frankenphp, it doesn't seem to work:
Reproduction
I've developed a simple controller that streams a response through SSEs.
You can reproduce and run the following project (you may need to install php and composer):
The following command works as expected:
The following command does not work (response seems buffered):
Credits
Credits for finding the bug go to @tharyrok
Relevant log output
http 1
http 2