Hi!

I have problems with MemCache Storage.

I saved a node, I show the expire message and then I run cron.
Also, In the logs, I see the recacher sucessful logs (200).
But the page is still showing the previous version.

Any idea?

Regards,
JOINSO

Comments

JOINSO created an issue. See original summary.

bburg’s picture

Sorry for replying to an old issue,

I think that Memcache storage fails to assemble the cache ids for objects it purges.

I was getting several PHP Notices like:

Notice: Array to string conversion in dmemcache_key() (line 1056 of /sites/all/modules/contrib/memcache/dmemcache.inc).

I jury rigged some code to throw an Exception and generate a stack trace, here is what I got (modified for readability):

Exception: $key is an array
#0 public/sites/all/modules/contrib/memcache/dmemcache.inc(461): dmemcache_key(Array, 'cache_page', true) 
#1 public/sites/all/modules/contrib/memcache/memcache.inc(351): dmemcache_delete(Array, 'cache_page', Object(Memcached)) 
#2 public/includes/cache.inc(173): MemCacheDrupal->clear(Array, false) 
#3 public/sites/all/modules/contrib/expire/includes/expire.api.inc(145): cache_clear_all(Array, 'cache_page', false) 
#4 public/sites/all/modules/contrib/expire/includes/expire.api.inc(121): ExpireAPI::executeInternalExpiration(Array, Array) 
#5 public/sites/all/modules/contrib/expire/includes/expire.node.inc(84): ExpireAPI::executeExpiration(Array, 'node', Object(stdClass)) 
#6 public/sites/all/modules/contrib/expire/expire.module(294): ExpireNode->expire(Object(stdClass), 1) 
#7 public/sites/all/modules/contrib/expire/expire.module(129): expire_execute_expiration('node', Object(stdClass), 1) 
#8 [internal function]: expire_node_insert(Object(stdClass)) 
#9 public/includes/module.inc(965): call_user_func_array('expire_node_ins...', Array) 
#10 public/modules/node/node.module(1180): module_invoke_all('node_insert', Object(stdClass)) 
#11 public/modules/node/node.pages.inc(459): node_save(Object(stdClass)) 
#12 public/includes/form.inc(1524): node_form_submit(Array, Array) 
#13 public/includes/form.inc(906): form_execute_handlers('submit', Array, Array) 
#14 public/includes/form.inc(386): drupal_process_form('blog_node_form', Array, Array) 
#15 public/includes/form.inc(131): drupal_build_form('blog_node_form', Array) 
#16 public/modules/node/node.pages.inc(78): drupal_get_form('blog_node_form', Object(stdClass)) 
#17 [internal function]: node_add('blog') 
#18 public/includes/menu.inc(527): call_user_func_array('node_add', Array) 
#19 public/index.php(21): menu_execute_active_handler() 
#20 {main} in dmemcache_key() (line 1068 of public/sites/all/modules/contrib/memcache/dmemcache.inc).

The related Expire module code seems to be ExpireAPI::processInternalPaths()

      // Collect array with information about expired URLs and its wildcards.
      $urls[$path] = array(
        'path' => $parsed_path['path'],
        'query' => !empty($parsed_path['query']) ? $parsed_path['query'] : array(),
      );

It's passing these as cache keys to cache_clear_all(). I would assume that this should be a string, not an array.

I guess according to the documentation for cache_clear_all(), it either accepts a cache id, or an array of cache ids. I perhaps the problem is the "query" parameter here, which can be whatever the value of $parsed_path['query'], or an empty array itself. Which seems like a bug to me.

sgdev’s picture