Cache middleware issues after restart when using mod_wsgi with PyLibMC
|Reported by:||Jim Dalton||Owned by:||nobody|
|Component:||Core (Cache system)||Version:||1.3|
|Cc:||oliver@…||Triage Stage:||Design decision needed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I'm running into a cache error using the PyLibMC cache backend in conjunction with mod_wsgi.
I have a strong feeling it's related to #15655 and is probably an issue for the pylibmc maintainers and not Django. I do feel, however, that the issue is worth reporting here because it is occurring on a pretty standard installation with the recommended web server (mod_wsgi). It also makes me wonder whether more robust error handling might need to be built into the PyLibMC backend to account for ways things could go wrong.
So, the gist of the problem: I have memcached running on a separate server and PyLibMC as the memcached backend. Things work great...until I restart memcached. After doing so I get the following traceback:
Traceback (most recent call last): File "/var/www/****/src/django/django/core/handlers/base.py", line 89, in get_response response = middleware_method(request) File "/var/www/*****/src/django/django/middleware/cache.py", line 143, in process_request cache_key = get_cache_key(request, self.key_prefix, 'GET', cache=self.cache) File "/var/www/*****/src/django/django/utils/cache.py", line 190, in get_cache_key headerlist = cache.get(cache_key, None) File "/var/www/*****/src/django/django/core/cache/backends/memcached.py", line 58, in get val = self._cache.get(key) UnknownReadFailure: error 7 from memcached_get: UNKNOWN READ FAILURE
Restarting Apache resolved this error.
The issue does not occur when using MemcachedCache backend.
Change History (7)
comment:5 Changed 6 years ago by
|Triage Stage:||Unreviewed → Design decision needed|