Hello, I'm getting an EntityMalformedException on cron runs if energy was emitted for a node and that node gets deleted before the energy is calculated on cron.
In _radioactivity_update_energy() I added a check to see if the entity exists
if(empty($entities)){
return;
}
right below the entity_load call (around line 226) and it was fixed.
thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | entity-exists-2293093-2.patch | 595 bytes | bropp |
Comments
Comment #1
loze commentedComment #2
bropp commentedRan into this issue as well. Patch attached, using loze's code.
Comment #3
yan commentedI had the same problem when I ran an upgrade from D6 to D7 (with this patch). I got the following error
The following updates did not run. Patch from #2 seems to solve it.
Comment #4
yan commentedI forgot to change the status.
Comment #5
monymirzaI have applied patch. then
drush cronbut it keeps cron run and finally error.Am i missed anything?
Comment #6
monymirzaComment #7
heine commentedmonymirza, after the patch, radioactivity will attempt to process all emits that were stalled due to the entitymetadatawrapper exception. In our case, 10s of millions. This causes the site to basically load all entities (as radioactivity misses a cache reset flag somewhere) and run out of memory. Best to truncate the table radioactivity_deferred_incidents.
This is also the reason why I set this patch to "needs work".
Comment #8
mikedotexe commentedThis is a pretty crucial patch, imho. I'm not sure "needs work" makes the most sense here.
The patch makes sure that future users of this module do not run into the issue. Retroactively "fixing" a site suffering from this bug is possibly better addressed case-by-case.
For instance, I'm working on a site that has 30,000 items waiting in the
radioactivity_deferred_incidentstable. We can have a conversation with the client about whether or not to truncate the table (to save on some CPU) or allow cron to process all of it, which is more accurate to the historical views and applied energies.That being said, I don't think it'd be fair to have a patch that says, "truncate the necessary tables" because that isn't ideal for all situations.
On the other side, it's not ideal to always have cron process all the items, like in comment #7.
I'm not the module maintainer and haven't contributed, but I've given it some thought lately and wanted to share my perspective. I think this patch is pretty important to merge in for preventative purposes.
Comment #9
oldspot commentedI agree with mikedotexe - technically the patch fixes the issue at hand and doesn't really need any "more work".
I ran into the same issue and the patch fixes it.
Indeed after fixing the code cron took a while to finish running as it had to process everything but if the issue wasn't there in the first place then people wouldn't have to deal with massive amounts of processing after fixing the issue.
Will change to RTBC again as it should really be committed to prevent more sites having this problem.
Comment #11
sutharsan commented