If a site is configured to have an apc cache or an opcache and they have configured their servers to not check the timestamps of files, new files placed on the filesystem will be ignored by the webserver.

https://symfony.com/doc/current/performance.html#don-t-check-php-files-t...

We'll need a mechanism that determines if this is the case and ensures the caches get flushed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mixologic created an issue. See original summary.

heddn’s picture

We can do a check during update and clear opcache, apc(u) cache if said things exist. Updates run via a button right now. So that will be fine for the most part. For eventually when drupal cron can be run via non web UI, we'll have to add a readiness checker to say it isn't possible. Because clearing apc/opcache via CLI wouldn't flush web.

Did I miss anything in this summary?

heddn’s picture

See https://symfony.com/doc/current/performance.html#don-t-check-php-files-t... for some laymans explanations of our options to clear cache.

Mixologic’s picture

Title: Question about in place updater » Add an apc/opcache clearing mechanism
Issue summary: View changes

Normally a webserver restart is required to get new versions of files.

And also,

Call the apc_clear_cache() or opcache_reset() functions via the web server (i.e. by having these in a script that you execute over the web);

So, there should probably be a mechanism to either detect or just clear the cache regardless of the setting when new files get deployed.

Mixologic’s picture

Category: Plan » Feature request
heddn’s picture

Status: Active » Needs review
FileSize
7.64 KB
heddn’s picture

I'd be curious if we even need apc support in this patch. From my poking around, it seems the opcode cache parts of apc where removed before PHP 5.6. Can someone confirm?

Mixologic’s picture

Oh, I meant for this to be an "in general" not a version specific. For 8.x you dont need to worry about the apc cache. Its for 7.x on older php's.

Except, this is just where I've been in php for so long I forgot when apc switched to opcache, so 5.5 and above is all opcache. Or rather, not worth supporting an "autoupdates" feature for somebody on a php version that hasnt had support for 4+ years.

heddn’s picture

Title: Add an apc/opcache clearing mechanism » Add an opcache clearing mechanism
FileSize
3.17 KB
6.77 KB

Updating title. The d7 module starts its support from php 5.6+. So it sounds like we just need to support opcache.

  • heddn committed 3273a22 on 8.x-1.x
    Issue #3088474 by heddn: Add an opcache clearing mechanism
    
heddn’s picture

Status: Needs review » Fixed

Thanks for the input @Mixologic. Incorporated and committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.