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
improve ARM support #26
Conversation
…-blocking accept() call on ARM machines It seems that accept() is ignoring the "infinite timeout" parameter (0 or -1) on ARM. This makes it return instantly without an actual connection. This kills the worker, which is restarted immediately. We could just wait for let's say 1 hour and live with the fact that our workers will be restarted again and again. But this fix is better. We cannot use the (functioning!) socket API directly (without stream support), because more stream functions are used later on that would have to be replaced as well. We replaced the stream_get_line() with fgets() to work around another issue: When selecting and accepting the connection, the s_g_l() would block for the default_socket_timeout duration before reading the request and handling it.
for historical purposes: upstream bug |
@xrstf I pushed first part of your patch (with minor editing). Please check if it works for you. Regarding second part, I'm waiting for some comments from you |
No, the second part of the patch (replacing stream_get_line with fgets) is unrelated to #20. We didn't test PHP < 3.5.11 and < 5.4 any further, since 5.3.10 was so broken. I'll test your changes later. Can take some time though, since I don't own an ARM device myself. |
So, what is the scenario when this patch is needed? cause everything seems to work here just fine without it and I have |
The patch is always needed when running on an ARM system. |
Well… Let's do it this way. @xrstf Can you submit this as a separate issue? It looks like a core bug, so I am not in favour of "fixing" this on AiP side, actually. But I might change my mind. And IMHO looks like it IS actually related to that old 5.3 bug. Closing this one, waiting for the new one which will be strictly |
I'm fine with that solution. :-) |
It seems that accept() is ignoring the "infinite timeout" parameter (0
or -1) on ARM. This makes it return instantly without an actual
connection. This kills the worker, which is restarted immediately. We
could just wait for let's say 1 hour and live with the fact that our
workers will be restarted again and again. But this fix is better.
We cannot use the (functioning!) socket API directly (without stream
support), because more stream functions are used later on that would
have to be replaced as well.
We replaced the stream_get_line() with fgets() to work around another
issue: When selecting and accepting the connection, the s_g_l() would
block for the default_socket_timeout duration before reading the request
and handling it.