See below hook for Entity module. IMO the menu_cache_clear_all() is always cleared, which is mostly unnecessary.
Isn't there a way to discover WHEN this is needed?

/**
 * Implements hook_entity_update().
 */
function taxonomy_menu_trails_entity_update($entity, $type) {
  switch ($type) {
    case 'node':
      //TODO replace with specific cache entries deleting
      menu_cache_clear_all();
      break;
    //TODO other entity types support
  }
}

Comments

johnv’s picture

Also, when running 2 node-bulk updates parallel, chances are high to get the following error:
PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction: DELETE FROM {cache_menu}; Array ( ) in cache_clear_all() (line 169 of ...\includes\cache.inc).

Dmitriy.trt’s picture

Status: Active » Fixed

Thanks for your bug report! Calls to menu_cache_clear_all() are not necessary anymore on 7.x-2.x (they were on 7.x-1.x). Fix committed and dev version will be packaged in the next 12 hours.

About deadlock issue you've mentioned. Function cache_clear_all() is not called from menu_cache_clear_all(), so these issues are not related. And Taxonomy Menu Trails doesn't call this function directly or indirectly (maybe I'm wrong?), so it's not this module's fault. Try to use xdebug debugging session with parallel non-xdebug session to find the reason of deadlock.

johnv’s picture

OK, thanx for the quick response!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.