I found this bug using zen theme which by default call on each page load drupal_rebuild_theme_registry which make this call: cache_clear_all('theme_registry', 'cache', TRUE);
So wildcard argument is set to true so cache_clear_all from cacherouter.inc on line 152 make this call:
$cache->delete($cid . '*', $table); with $cid = 'theme_registry' and $table = 'cache'.
Personally, i'm using apc engine as a cache backend and here is the code of apc delete function (when wildcard set to true):
if (substr($key, -1, 1) == '*') {
$key = substr($key, 0, strlen($key) - 1);
$lookup = apc_fetch($this->lookup);
foreach ($lookup as $k => $v) {
if (substr($k, 0, strlen($key) - 1)) {
apc_delete($k);
unset($lookup[$k]);
}
}
if ($this->lock()) {
apc_store($this->lookup, $lookup);
$this->unlock();
}
}
if (substr($k, 0, strlen($key) - 1)) will always be true 'cause substr returns at least an empty string, so i think it should compare substr result with $key like this:
if (substr($k, 0, strlen($key) - 1) == $key)
After this modification, it seems to work.
hope this helps.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | cache_router_apc_engine_fix.patch | 520 bytes | vinzentt |
| #4 | cache_router_apc_engine_fix.patch | 466 bytes | vinzentt |
Comments
Comment #1
vinzentt commentedComment #2
vinzentt commentedComment #3
vinzentt commentedComment #4
vinzentt commentedhere is the patch corresponding to the bug fix i mentionned.
Comment #5
vinzentt commentedsame patch but with the exacts paths
Comment #6
slantview commentedThis is fixed in my latest commits. Thanks.