Refer to #1967266: Stop flushing entire entity load cache bins unnecessarily for more details.

Wherever possible, only flush the necessary entities from the cache, using entity_get_controller($entity_type)->resetCache(array($entity_id));

In this module quiz_insert() sometimes does this:

$old_quiz = node_load($node->clone_from_original_nid, NULL, TRUE);

I haven't examined what's going on here in detail, but assuming it is necessary for the load cache to be bypassed for this particular load, then use entity_load_unchanged($entity_type, $id) to load it (which runs the resetCache() and load() sequence for that single ID).

(Or if the reset was actually to flush something else, then just flush that thing explicitly.)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jweowu created an issue. See original summary.

jweowu’s picture

djdevin’s picture

Status: Needs work » Needs review
FileSize
514 bytes

I'm not sure why that is there (probably very old) so I'll just remove it if the tests pass.

  • djdevin committed 7015f17 on 7.x-5.x authored by jweowu
    Issue #2750513 by djdevin, jweowu: Don't use $reset flag with node_load...
djdevin’s picture

Status: Needs review » Fixed

Status: Fixed » Needs work

The last submitted patch, 3: don_t_use_reset_flag-2750513-3.patch, failed testing.

djdevin’s picture

Status: Needs work » Fixed
jweowu’s picture

Thanks for following up, djdevin.

Please don't mark someone as the author of a commit which they didn't author, though. I do appreciate the good intent behind it, but I've seen cases of people actually introducing bugs in someone else's name, so you should only ever set the author of a commit if that person actually wrote the patch.

Status: Fixed » Closed (fixed)

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