Help with threading.local use in python-memcache module.

S

Sean Reifschneider

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Some time ago I accepted a patch to base the memcache client module on
the threading.local class. Now I've got some reports of issues with
this that I'm not sure what the best way to resolve is.

Bug #530229: https://bugs.launchpad.net/python-memcached/+bug/530229
says:

Client is derived from threading.local presumably at some misguided
sense of working across multiple threads. However this doesn't work
if the same Client is used across threads serially.

For instance if I create a client in one thread and then call
set_servers and then use the Client in another thread the set_servers
call would have had no effect since the servers and buckets are
per-thread due to threading.local.

and that the set_servers call only impacts one thread rather than them all.

I'm a bit reluctant to just remove threading.local, in case anyone is
relying on it now that it's in there. But I'd like to offer a solution for
the cases where it doesn't work.

Any suggestions on the solution for this?

Thanks,
Sean
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iD8DBQFNC9TixUhyMYEjVX0RAnOWAJwKZnmE/6cKR4I4tl4Km//gtkxo1QCgvK1Y
ULmOdWnAViTzAS4sMts97ZA=
=7qXJ
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top