disqus / gargoyle

Feature switches in Django
http://engineering.disqus.com
Apache License 2.0
746 stars 112 forks source link

Sporadic TypeErrors from gargoyle.is_active #64

Open acdha opened 11 years ago

acdha commented 11 years ago

Our gargoyle install very sporadically tosses a type error modeldict/base.py:26 where a simple return self._local_cache[key] fails because _local_cache is None.

I suspect this is due to a race condition as we have gargoyle configured using a locmem cache, which should be reliable, and so far it appears that all of these have occurred early after a new server process startup.

jamescarr commented 9 years ago

Seeing this as well when using a different cache backend.


  File "/home/ubuntu/.virtualenvs/app/src/gargoyle/gargoyle/models.py", line 298, in __getitem__
    return SwitchProxy(self, super(SwitchManager, self).__getitem__(key))
  File "/home/ubuntu/.virtualenvs/app/local/lib/python2.7/site-packages/modeldict/base.py", line 26, in __getitem__
    return self._local_cache[key]
TypeError: 'bool' object has no attribute '__getitem__'