Code

Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#3701 closed (duplicate)

Memcached backend is not thread-safe

Reported by: samuel@… Owned by: nobody
Component: Core (Cache system) Version: master
Severity: Keywords: memcached
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 (0)

Change History (7)

comment:1 Changed 7 years ago by samuel@…

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

comment:2 Changed 7 years ago by Simon G. <dev@…>

  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 7 years ago 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

comment:4 Changed 6 years ago by mcroydon

  • Resolution set to invalid
  • Status changed from new to closed

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.

comment:5 Changed 6 years ago by mcroydon

  • Resolution invalid deleted
  • Status changed from closed to reopened

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.

comment:6 Changed 6 years ago by mcroydon

  • Resolution set to duplicate
  • Status changed from reopened to closed

Dupe of #5133.

comment:7 Changed 6 years ago 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 Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.