Ticket #152 (new defect)
Opened 8 months ago
Weird PHP errors when files get deleted and copied again (multiple times in cache)
Description
I have a demo setup for a PHP application and to reset it, I'm removing all files and copying them anew ("rm /path/to/app -rf && cp -a /source /path/to/app").
This causes weird PHP errors like "call to undefined function", "cannot redeclare foo()" or "Class 'DataObject?' not found".
After removing the xcache cache, it works again.
Looking at the cached files, there a duplicates, e.g.:
php#0 71 /path/inc/generic/model/_genericcache.class.php 0 0 6.04 K 2.79 K 4 M 2051 508796 8 m 8 m php#0 72 /path/inc/generic/model/_genericcache.class.php 2 0 6.04 K 2.79 K 4 M 2051 508795 10 s 8 m
I'm not sure if this is related to the PHP files being accessed during "deletion" and have not tried to create a smaller testcase.
I've tried using xcache.readonly_protection=On, but it still broke.
A workaround appears to be using "/bin/cp -a --no-preserve=timestamps" to copy the files to the same place again (--no-preserve=timestamps is the key here).
My settings: xcache.admin.enable_auth On
xcache.cacher On xcache.coredump_directory no value xcache.count 1 xcache.gc_interval 0 xcache.mmap_path /dev/zero xcache.readonly_protection 1 xcache.shm_scheme mmap xcache.size 10M xcache.slots 8K xcache.stat On xcache.test 0 xcache.ttl 0 xcache.var_count 1 xcache.var_gc_interval 120 xcache.var_maxttl 0 xcache.var_size 64K xcache.var_slots 8K xcache.var_ttl 0
I'm using the 1.2 branch and PHP_5_2 (both uptodate).

