-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
dev/core#4055 Remove OPCache risk in the extension class loader #25235
Conversation
(Standard links)
|
I wonder if the name of the file generated by The filename should probably be |
Hi @braders, changing the filename is an excellent idea. I will update the PR. |
…s no real php file
This sounded a bit like https://lab.civicrm.org/dev/core/-/issues/4054 - but perhaps there is no overlap |
Looks indeed similar, a cache that retrieves an outdated result. |
Can one of the admins verify this patch? |
The funny thing is -- using the op-code cache was kind of the point. You can find various authors who suggest caching semi-permanent data as
My default position is to assume that opcode cache is better for regular pageloads, although this not certain.
I suppose the ideal is to benchmark. But let me throw out one alternative -- there was a vaguely similar issue for c76bdfc#diff-4f4d71cf8bcad044570b79ff938e54e9695649ee124b96a6fcfc5e1ef36f555f - $envId = \CRM_Core_Config_Runtime::getId();
+ $envId = md5(implode(',', array_merge(
+ [\CRM_Core_Config_Runtime::getId()],
+ array_column(\CRM_Extension_System::singleton()->getMapper()->getActiveModuleFiles(), 'prefix')
+ )));
$file = \Civi::paths()->getPath("[civicrm.compile]/CachedCiviContainer.{$envId}.php"); We could try an analogous change in |
Overview
It is a code thing. The extension class loader used
require
to load configuration. When OPCache is enabled, this adds the risk that outdated configuration is used, specially when extensions are installed. A use case can be found at https://lab.civicrm.org/dev/core/-/issues/4055Before
After
Technical Details
Comments
Updating this code directly causes a nasty error because the configuration format is changed. Using
cv flush
solves this, because it removes the cache files.