-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Opcache with file_cache and JIT enabled crashes an application #15497
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
/cc @dstogov |
This error may be caught only in PHP-8.2. |
The bug should be fixed now.
Please check if the the fix works for you. It seems we have some different problem with PCRE cache... |
Uh oh!
There was an error while loading. Please reload this page.
Description
On our production server running a Symfony application with PHP-FPM and Nginx, I've noticed an occasional strange behavior: after an HTTP request, we sometimes receive an empty response with a 200 HTTP status code. In the PHP-FPM logs, I see the following message:
Error: Shared memory lock not obtained
After conducting some tests, I realized that this error occurs only when the file_cache and JIT options are enabled. Additionally, I noticed that the
max_accelerated_files
option also plays a role in this behavior. Our application is quite large, so this setting is configured to 20,000 on our production server. However, if I turn off thefile_cache
, everything works fine, even with themax_accelerated_files
set to its minimum value (200 instead of 20000). The same happens with JIT turned off - everything works well, with JIT disabled.To reproduce this behavior locally, I created a simple project: I downloaded the same version of Symfony that we have in production (6.4), built the application using PHP and Nginx images from Docker Hub, and decreased the
max_accelerated_files
to its minimum value (200, according to the documentation).Steps to reproduce:
First, let's make sure that everything works fine:
Expected response:
Logs from php-fpm container:
Then, let's change the
max_accelerated_files
Bad behavior (no response body at all):
Logs from php-fpm container:
Then let's override the existent
file_cache
option and turn it off:Everything works as expected then:
Logs:
More information for context
PHP versionphp -m
php -i|grep opcache.
PHP Version
PHP 8.2.22
Operating System
Ubuntu 22.04.4
The text was updated successfully, but these errors were encountered: