#20176: cache.set() fails silently -------------------------------------+-------------------- Reporter: mali@… | Owner: nobody Type: Uncategorized | Status: new Component: Core (Cache system) | Version: 1.5 Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 1 Easy pickings: 1 | UI/UX: 0 -------------------------------------+-------------------- BaseMemcachedCache throws the result of its internal .set() away, so there is no feedback on whether it failed or not. I just spent day trying to figure out why my site was falling over and why the pages weren't getting cached. This is potentially deadly since it lulls you into thinking you have more capacity than you actually have.
I know this was discussed before as per: https://code.djangoproject.com/ticket/17249 but the behavior here is especially egregious. Can we at least gather thoughts on how we might handle this? I understand why exceptions are not possible to do without breaking compat. Maybe we could have a check_success flag? Or maybe we could have a config option for cache to except? Simply returning True / False is also an option that'd be backwards compatible and backend agnostic. I'll start enumerating backends I know in terms of returning success and maybe people can help: python-memcached returns nonzero on success. https://github.com/linsomniac /python-memcached/blob/master/memcache.py#L563 pylibmc seems to have access to the data (https://github.com/simplegeo/pylibmc/blob/master/_pylibmcmodule.c#L289) but doesn't return it https://github.com/simplegeo/pylibmc/blob/master/pylibmc.py#L58 db cache? filesystem? locmem? Also, is it terribly wrong to say "if your backend doesn't support success reports, we'll return None"? Cheers, and thanks in advance. -- Ticket URL: <https://code.djangoproject.com/ticket/20176> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.