Opened 11 years ago

Closed 10 years ago

Last modified 10 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:


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:

Change History (7)

comment:1 Changed 11 years ago by samuel@…

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

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

Triage Stage: UnreviewedAccepted

comment:3 Changed 11 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).

comment:4 Changed 10 years ago by mcroydon

Resolution: invalid
Status: newclosed

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 10 years ago by mcroydon

Resolution: invalid
Status: closedreopened

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 10 years ago by mcroydon

Resolution: duplicate
Status: reopenedclosed

Dupe of #5133.

comment:7 Changed 10 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.

Note: See TracTickets for help on using tickets.
Back to Top