#33092: Add note regarding thread-safety when using PyMemcacheCache.
--------------------------------------+------------------------------------
     Reporter:  Martijn van der Blom  |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Core (Cache system)   |                  Version:  3.2
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by Nick Pope):

 That's interesting - I'll have to have another try later.

 I don't know a great deal about this... Perhaps the issue is that
 `PooledClient` is using  `threading.Lock`. See
 
[https://github.com/pinterest/pymemcache/blob/b6d83f89fb93dfe7a006b470af487f113739cc56/pymemcache/pool.py#L32-L35
 here].

 As mentioned
 [https://github.com/gevent/gevent/issues/1381#issuecomment-478707377 here]
 some monkey patching needs to be done with `gevent.monkey.patch_all()`,
 but it seems that is
 
[https://github.com/benoitc/gunicorn/blob/f145e90e322256f1c4e1eea8e175d2e188ceab43/gunicorn/workers/ggevent.py#L38
 already handled] by gunicorn for the gevent worker.

 Perhaps you can try passing `lock_generator` in `OPTIONS` with a different
 lock type, e.g. see https://www.gevent.org/api/gevent.lock.html

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33092#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.375809ee57a5c2bc7e7520b62c1a9842%40djangoproject.com.

Reply via email to