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

Discussion in 'Python' started by Sean Reifschneider, Dec 17, 2010.

  1. -----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-----
    Sean Reifschneider, Dec 17, 2010
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Granger

    [ANN] MemCache 0.0.1

    Michael Granger, Nov 14, 2004, in forum: Ruby
    Replies:
    0
    Views:
    76
    Michael Granger
    Nov 14, 2004
  2. Michael Granger

    [ANN] Ruby-MemCache 0.0.2

    Michael Granger, Dec 2, 2004, in forum: Ruby
    Replies:
    0
    Views:
    75
    Michael Granger
    Dec 2, 2004
  3. benny
    Replies:
    1
    Views:
    149
    Evan Webb
    Apr 25, 2005
  4. Michael Granger

    [ANN] Ruby-MemCache 0.0.4

    Michael Granger, Oct 14, 2005, in forum: Ruby
    Replies:
    0
    Views:
    73
    Michael Granger
    Oct 14, 2005
  5. unni.tallman

    Memcache...HELP..!!

    unni.tallman, Oct 18, 2006, in forum: Ruby
    Replies:
    1
    Views:
    78
    Ben Bleything
    Oct 18, 2006
Loading...

Share This Page