-
-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug with parallel #791
Comments
Parallel extension probably isn't compatible with go stacks/memory, if I had to guess (possibly collisions with channels and other shenanigans, plus maintaining threads). It's probably better to break out the Parallel code into a separate, regular php file. I have been doing that for quite some time. I should probably open source my Parallel shims... |
The problem has been reported upstream and parallel has been unbundled from FrankenPHP. krakjoe/parallel#308 |
Hey @davidnurdin 👋 the error echo "foo";
flush(); at the beginning of the file. What might be happing is the following: As soon as output is started, PHP will start creating the HTTP-Response. In case you are using user land threads (as the example code above would), you end up having two threads that do write to the same buffers/socket. I assume that both threads do
I'll have a look if I can see something and get back to you |
Hey @dunglas, can you help me running FrankenPHP with Besides goroutines 106 and 35 all seem to be idling, while 106 and 35 seem both to access the responseWriter. I do assume that 106 is the thread echoing out the This is all assumptions, but this is as far as I could understand things happening. But it boils down to the main problem being the concurrency with two (or more) threads that share the same underlying structures and streams in the SAPI without synchronisation. I assume we'd need to guard access to whatever "concurrent map read and map write" is referring to with a mutex. What do you think @dunglas? |
What happened?
Seem on version 1.2.5 , parallel is crashing (with server mode)
sudo ./frankenphp-linux-x86_64 php-server index.php
===> Loading N times http://localhost
Working some times then crash 👍
Build Type
Docker (Debian Bookworm)
Worker Mode
Yes
Operating System
GNU/Linux
CPU Architecture
x86_64
PHP configuration
Relevant log output
No response
The text was updated successfully, but these errors were encountered: