[Asterisk-code-review] sorcery: Fix sorcery wizard create so it creates in caches (asterisk[master])

George Joseph asteriskteam at digium.com
Fri Feb 26 17:14:54 CST 2016


George Joseph has posted comments on this change.

Change subject: sorcery:  Fix sorcery_wizard_create so it creates in caches
......................................................................


Patch Set 1:

> I've removed my +1 from this review pending some sort of comment
 > from Josh.
 > 
 > The code here was actually written this way purposely. The idea is
 > that when sorcery creates an object, it doesn't automatically get
 > added to the cache. Instead, when the object is retrieved from the
 > non-caching backend for the first time, it is then added to the
 > cache.
 > 
 > I'm not really sure what the advantage is to waiting until
 > retrieval to add to the cache. My only guess is that it's a
 > potential memory saver?
 > 
 > It's possible that in Ross's case, the contact was created in the
 > non-caching backend, and then nothing ever attempted to retrieve
 > that contact before it was deleted. The result is that the contact
 > never was added to the cache so it couldn't get deleted.

The issue with contacts is that they don't get added to the cache until the next retrieval so if they get deleted before then, memory_cache complains that it wasn't found.  I could have removed the log message but neither Josh nor I could remember why create just didn't add it in the first place.  I figured that it was better to correct the cache behavior than just remove the error.

-- 
To view, visit https://gerrit.asterisk.org/2313
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id5596ce691685a79886e57b0865888458d6e7b46
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-HasComments: No



More information about the asterisk-code-review mailing list