﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
15729	Cache middleware issues after restart when using mod_wsgi with PyLibMC	Jim Dalton	nobody	"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."	Bug	closed	Core (Cache system)	1.3	Normal	needsinfo		oliver@…	Design decision needed	0	0	0	0	0	0
