Django

Code

Ticket #3701 (closed: duplicate)

Opened 3 years ago

Last modified 2 years ago

Memcached backend is not thread-safe

Reported by: samuel@descolada.com Assigned to: nobody
Milestone: Component: Cache system
Version: SVN Keywords: memcached
Cc: Triage Stage: Accepted
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Django relies on the cache backend to be thread-safe, and a single instance of a memcache.Client is not thread-safe. The issue is with Django only creating a single instance that is shared between all threads (django.core.cache.cache).

Also discussed here: http://groups.google.com/group/django-developers/browse_thread/thread/c7566757bae3f139

Attachments

Change History

03/10/07 16:43:58 changed by samuel@descolada.com

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

I should mention for posterity that the memcache.py version I'm referring to is 1.34 (currently the latest I believe).

03/10/07 19:21:45 changed by Simon G. <dev@simon.net.nz>

  • stage changed from Unreviewed to Accepted.

06/25/07 11:42:33 changed by anonymous

A new version of the python memcache module exists that fixes this issue; however, this ticket may still be valid for other cache backends (I haven't tried them).

http://lists.danga.com/pipermail/memcached/2007-June/004482.html

12/01/07 11:09:53 changed by mcroydon

  • status changed from new to closed.
  • resolution set to invalid.

According to the previous comment, this has been fixed since python-memcached 1.36 and the current release is up to 1.40. Reopen if it's still an issue in newer versions.

12/01/07 11:15:38 changed by mcroydon

  • status changed from closed to reopened.
  • resolution deleted.

Still investigating if this is still an issue. Marking this as a dupe of #5133, which has a patch but may not be the best way to go about it.

12/01/07 11:15:48 changed by mcroydon

  • status changed from reopened to closed.
  • resolution set to duplicate.

Dupe of #5133.

12/01/07 11:23:16 changed by mcroydon

As mentioned in the resolution of #5133, it looks like this has been fixed in python-memcached 1.4.0. Please try with 1.4.0 or the latest version available, that should solve your problem.


Add/Change #3701 (Memcached backend is not thread-safe)




Change Properties
Action