I see what you mean. But still, if my interpretation is correct, in those cases we should see the *__lock key stored. What is weird about my specific issue is that there was no *__lock key.
Anyway, regardless upgrading web2py, now I'm wondering if I should set with_lock True or False. Do you have any suggestion? The book says: "*Redis cache subsystem allows you to prevent the infamous "thundering herd problem": this is not active by default because usually you choose redis for speed, but at a negligible cost you can make sure that only one thread/process can set a value concurrently.*" I haven't found comments regarding when is best to use with_lock=True and when to use with_lock=False. I'm guessing with_lock=True is best when the process that generates the data that is going to be cached takes long time or uses much resources. That's not my case, so I'm tempted to change it to False, but I'm not sure about the decision. If you have any experience or suggestion about that, I'll appreciate you comment about it. Thanks again. Regards, Lisandro. El viernes, 20 de abril de 2018, 12:19:11 (UTC-3), Anthony escribió: > > On Friday, April 20, 2018 at 10:47:10 AM UTC-4, Lisandro wrote: >> >> Thank you very much for your time Anthony. >> >> Yes, I use Redis with_lock=True. >> I checked but there is no *__lock key stored in Redis. I double checked >> that. >> >> But, giving you mentioned with_lock, I tried to set with_lock=False, and >> it worked. >> Then I set with_lock=True again, and it worked too. >> *Apparently, the problem went away after executing the request one time >> with_lock=False, and then I could set it back to True and it kept working >> ok*. >> >> I'm using an old version of web2py (2.10). >> > > Looking at the code > <https://github.com/web2py/web2py/blob/R-2.10.1/gluon/contrib/redis_cache.py#L140> > > under 2.10, it is not clear what the problem could be, as the locking code > is in a try block and there is a "finally" clause that deletes the lock key > if there is an exception. > > The current code in master looks like it could result in a lock being > stuck if an exception occurs while storing or retrieving a cache item. > > Anthony > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.