-
-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyError TTLCache #80
Comments
@rafaelsimbiose: No, as far as I can tell from your report, this is not expected. Can you provide a test case to reproduce this? Is your code multi-threaded, and you forgot to lock access to |
@tkem I discovered the problem, it really was something that was not doing the lock with threads, I'll close the issue. Thank so much. |
You're welcome! Maybe I should state this more prominently in the docs... |
cachetools cache is not thread safe and there were frequent exceptions logged indicating that cache updates during async calls were failing with key errors similar to those described in: tkem/cachetools#80 Add a lock per table instance synchronizes cache updates across threads in.
* Temporarily use fork for starlette 0.21 release The 0.21 release resolves a frequent error on our fastapi version. See: encode/starlette#1710 encode/starlette#1715 * Disable FTP as function app deploy option Security controls * Trace request attributes before invoking middleware If an exception is raised in subsequent middlewares, added trace attributes will still be logged to Azure. This allows us to find requests that fail in the logs. * Make config cache thread safe cachetools cache is not thread safe and there were frequent exceptions logged indicating that cache updates during async calls were failing with key errors similar to those described in: tkem/cachetools#80 Add a lock per table instance synchronizes cache updates across threads in. * Lint * Changelog
Hi, I received KeyError when I attributed the value to cache using TTLCACHE, for example:
I have this cache:
And error ocurred now:
This traceback happens when he called self.expire and crash in del self.data[key] into cache_delitem method, he returned KeyError.
Is this expected?
Thanks !
The text was updated successfully, but these errors were encountered: