Gargoyle + Eventlet

33 views
Skip to first unread message

Mat Clayton

unread,
Mar 21, 2012, 8:52:46 AM3/21/12
to disqus-o...@googlegroups.com, Sam Cooke
Hey guys,

We recently switched to using Eventlet workers in Gunicorn, and have started seeing race conditions in gargoyle, more specifically django-modeldict, we are running the latest build of both. This has only come to light as we are seeing serious packet loss on our network at the moment, and memcached occasionally hangs for 3 Seconds, during a TCP retransmission. Either way what we are seeing is that one thread yields on https://github.com/disqus/django-modeldict/blob/master/modeldict/base.py L104 during the memcached call, and during this time, another greenthread completes its request and fires the _cleanup() method, setting _cache to None, causing unsubscriptable errors on L26.

It seems that due to the way the local _cache behaves this should be a thread local? However I now have issues with registering conditions as these are only registered on the first thread, and not globally.

Any recommendations for fixing this, or getting gargoyle and gunicorn/eventlet running smoothly together?

Thanks,
Mat

David Cramer

unread,
Mar 22, 2012, 1:13:32 AM3/22/12
to disqus-o...@googlegroups.com, disqus-o...@googlegroups.com, Sam Cooke
Hey Mat

This sounds like it might be a bit problematic to change. I think the right approach is a thread local, but at the moment I don't have much free time so I can't dig into it myself.

Reply all
Reply to author
Forward
0 new messages