-
Notifications
You must be signed in to change notification settings - Fork 7.8k
FPM: keepalived connection with fastcgi_finish_request causes dead lock #10335
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
Comments
I have been doing some debugging and this is really an issue. Basically I have been thinking about possible solutions and I can't see a way how to easily address it without closing the connection. Basically it would either require some sort of forking which is most likely more expensive than closing the connection or it would require ZTS which is not usual for FPM and probably not a good idea either due to complexity. In terms of closing the connection, I'm not sure if it should be done in the function as it all depends on server / FPM configuration so maybe we should just add option that will control if the connection should be always closed after |
The issue arises when keepalive is used alongside |
The problem is that it requires changes to code for something which is more an operational thing. To me it makes sense to give administrator control over this which is essentially configuration option that effects every fastcgi_finish_request call. |
Sure, I have just introduced a new option as the default value for the |
Is this possibly also the cause of #18275 ? EDIT: yes, indeed it is! |
Description
The following code:
with FPM settings:
and NGINX settings:
Resulted in this log:
But I expected this output instead:
This is easy to reproduced by the above desc, IMHO the log is clearly show’s the current PHP‘s behavior is something error.
the reason I think is after proc-X called
fastcgi_finish_request
this connection is marked reuseable by proxy and if the same process soon req same host the proxy might select the same connection then deadlock happens.this also can be showing by GDB/tcpdump
so I made this #10273
PHP Version
7.4-8.2
Operating System
Ubuntu 20.04
The text was updated successfully, but these errors were encountered: