Problematic situation:

produce image cache using one preset and 2 images with same filename but different directories, eg:

"files/somename/1.jpg"
"files/someothername/1.jpg"

For those 2 files displayed at the same page with same preset lockfile is the same.

Race condition that hits the lockfile (putting error about "file already being processed" in watchdog):

1. User browsers the site with 2 images which don't have cached image yet. (2 request at same time).
2. first request: _imagecache_cache creates lockfile "presetname1.jpg" for first file.
3. second request: _imagecache_cache bumps the lockfile "presetname1.jpg", error.
4. first request: _imagecache_cache finished rendering the file, sending to browser and writing to file.
5. first request: registered exit functions removes lockfile "presetname1.jpg".

Result: User that visits page with 2 images not yet cached see only one of them. After refreshing the browser things back to normal.

Comments

fizk’s picture

Status: Active » Closed (won't fix)