Style derivatives are skipped because file_exists check returns false positive

Created on 7 January 2021, over 3 years ago
Updated 30 January 2022, over 2 years ago

Problem/Motivation

The `file_exists` check on a derivative style URI in doWarmup may incorrectly return TRUE even if the file doesn't actually exist.

Steps to reproduce

I'm not even close to understanding the conditions under which this happens, but on a Pantheon site style creations are being skipped for some files. The problem turns out to be the `file_exists` check, so I'd speculate this has to do with some kind of filesystem race condition or a very sticky stat cache (https://www.php.net/manual/en/function.clearstatcache.php)

It may be important to note this module is being used to create images styles (in bulk using the queue) for image files that were uploaded earlier.

Proposed resolution

For now I'm just removing the conditional and forcing generation of every style, every time. This is slow so don't accept this patch in its current form.

Remaining tasks

Figure out why the stat cache thinks these files exist when they don't. Can the problem be fixed by clearing the stat cache before a queue run?

User interface changes

N/A

API changes

N/A

Data model changes

N/A

πŸ› Bug report
Status

Postponed: needs info

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024