Bug #71574 [Opn->Csd]: Opcache corruption after using opcache_reset()
Edit report at https://bugs.php.net/bug.php?id=71574&edit=1
ID: 71574
Updated by: laruence@php.net
Reported by: ruudk at mphuis dot com
Summary: Opcache corruption after using opcache_reset()
-Status: Open
+Status: Closed
Type: Bug
Package: opcache
Operating System: Ubuntu 14.04.3 LTS
PHP Version: 7.0.3
-Assigned To:
+Assigned To: laruence
Block user comment: N
Private report: N
New Comment:
The fix for this bug has been committed.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2016-02-12 09:13:55] ruudk at mphuis dot com
Description:
------------
Sometimes, after running a deploy using Capistrano and clearing the Opcache using a curl request
that executes opcache_reset() we get loads of 500 Internal Server errors.
In our error log we see something like this:
[12-Feb-2016 08:45:31 UTC] PHP Fatal error: Class
'CartBundle\Service\PaymentService���' not found in
/company/releases/20160212084602/cache/prod/frontendProdProjectContainer.php on line 7805
It's never the same class that's missing, it's never the same server that has the
problem. It occurs random.
The solution is always to execute the opcache_reset() again or to restart PHP FPM.
Some more errors:
[10-Feb-2016 15:33:10 UTC] PHP Fatal error: Class
'Monolog\Handler\AbstractProcessingHandler���' not found in
/company/releases/20160210153329/cache/prod/classes.php on line 1111
PHP Warning: include(): Failed opening
'/company/releases/20160209133021/vendor/richsage/rms-push-notifications-bundle/RMS/PushNotificationsBundle/RMSPushNotificationsBundle.php�php'
for inclusion (include_path='.:/usr/share/php:') in
This one is also remarkable, because you see lots of weird characters in the filename.
Feb 09 14:29:51 website-webserver-i-46b1b4cb php_errors.log: [09-Feb-2016 13:29:50 UTC] PHP Warning:
include(): Failed opening
'/company/releases/20160209133021/vendor/richsage/rms-push-notifications-bundle/RMS/PushNotificationsBundle/RMSPushNotificationsBundle.php���(N{�k'
for inclusion (include_path='.:/usr/share/php:') in
So to me it appears to be a race condition that corrupts the opcache. We run 2 of 3 webservers
behind a loadbalancer with a couple of hundred people online simultaneously.
We use the following opcache settings (rest is standard):
[opcache]
; Determines if Zend OPCache is enabled
opcache.enable=1
; The OPcache shared memory storage size.
opcache.memory_consumption=192
; The amount of memory for interned strings in Mbytes.
opcache.interned_strings_buffer=16
; The maximum number of keys (scripts) in the OPcache hash table.
; Only numbers between 200 and 100000 are allowed.
opcache.max_accelerated_files=32531
; How often (in seconds) to check file timestamps for changes to the shared
; memory storage allocation. ("1" means validate once per second, but only
; once per request. "0" means always validate)
opcache.revalidate_freq=1
It looks to be related to https://bugs.php.net/bug.php?id=70656 which is
closed/solved.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71574&edit=1
Thread (6 messages)