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