From time to time, we experience corrupt opcaches that cause outages which can cause various random errors to occur. After investigating we found that certain processes we use call Matomo console commands which result in the reset of the opcache. We believe it is likely that multiple concurrent opcache resets might result in the corrupt opcache.
This PR simply provides a configuration switch which can be used to disable opcache resets. This is off by default. When enabled this configuration will allow better control over the opcache and will likely allow us to avoid opcache corruption.
This configuration change was added in the cache section of the configuration as such:
Thanks @justinvelluppillai I'll make a fix for those and I'll keep those on file when making PRs in future.
fyi @samjf we may also need to add an
opcache_invalidate (if method exists) in https://github.com/matomo-org/matomo/blob/4.12.2/core/Config.php#L476 like we do in https://github.com/matomo-org/matomo/blob/4.12.3/core/Updates/2.5.0-rc2.php#L30-L32