Re: [Django] #28342: PyLibMCCache throwing exceptions when memcached server is down

2017-06-27 Thread Django
#28342: PyLibMCCache throwing exceptions when memcached server is down
-+-
 Reporter:  Julian Andrews   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Core (Cache system)  |  Version:  1.11
 Severity:  Normal   |   Resolution:
 Keywords:  memcached cache  | Triage Stage:
  pylibmc|  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Julian Andrews):

 My current workaround is subclass of `PyLibMCCache` which catches
 `pylibmc.ConnectionError` or `pylibmc.ServerDown` for each operation, and
 then does whatever `MemcachedCache` is doing in each case. I'd be happy to
 turn that into a PR for a change to `PyLibMCCache` if that approach is
 good. I'm not sure if there are other sorts of exceptions that `pylibmc`
 raises that should also be handled, but I think it would be a good start.

--
Ticket URL: 
Django 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.0bada2c9e11f79652a7007e0f72fcc60%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #28342: PyLibMCCache throwing exceptions when memcached server is down

2017-06-27 Thread Django
#28342: PyLibMCCache throwing exceptions when memcached server is down
-+-
   Reporter:  Julian |  Owner:  nobody
  Andrews|
   Type:  Bug| Status:  new
  Component:  Core   |Version:  1.11
  (Cache system) |   Keywords:  memcached cache
   Severity:  Normal |  pylibmc
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 If your memcached server is down, pylibmc will raise a
 `pylibmc.ConnectionError` or `pylibmc.ServerDown` exception for all
 operations. This is different from the behavior of the `python-memcached`
 package (see http://sendapatch.se/projects/pylibmc/misc.html). However,
 the `PyLibMCCache` cache backend does nothing to catch these errors. As a
 result, the behavior is different from the `MemcachedCache` backend which
 fails silently.

 This behavior is particularly problematic for fragment caches which
 obviously shouldn't raise an exception. In any case, it seems pretty clear
 that both backends should have the same behavior.

 

 Steps to reproduce:

 1. Setup a Django app `CACHES` set to use `PyLibMCCache`:

 {{{
 CACHES = {
 'default': {
 'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
 'LOCATION': '127.0.0.1:11211',
 }
 }
 }}}

 2. With no active memcached server open a shell and run:

 {{{
 from django.core.cache import cache
 cache.get('foo')
 }}}

 `pylibmc` will raise an exception. Using `MemcachedCache`, `cache.get`
 will instead return `None`.

--
Ticket URL: 
Django 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/056.cb8826f64026c40fd15cb4f51f2c685d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.