stale cache sort of bug
-
I’m using the APC object-cache drop in and vastly speeds up requests. And this isn’t exactly a bug in it, but I think it’s the best place to fix it.
The thing is wp_cache_set. It calls apc_store and that fails if APC is doing an expunge and probably more reasons. But no call to wp_cache_set actually handles that failure. Then the next wp_cache_get returns stale data.
I patched object-cache.php to log when apc_store fails and tries to delete the stale entry:
$result = apc_store( $key, $store_data, $expire ); if ($result === false) { apc_fetch($key, $success); if ($success) { if (apc_delete( $key )) { trigger_error("apc_store($key) failed, deleted old entry"); } else { trigger_error("apc_store($key) failed, apc_delete also failed. Corruption!"); } } else { trigger_error("apc_store($key) failed, would have been new entry"); } } return $result;
My logs have several “apc_store($key) failed, deleted old entry” messages.
Does this make sense? Thanks!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘stale cache sort of bug’ is closed to new replies.