-
-
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 on value assignment #90
Comments
Is your code multi-threaded? |
Yep. Very much so. However, the fault was repeatable. So this particular callstack isn't a race condition problem. |
Contrary to popular believe, Cache instances are not thread-safe. Neither is, for example, |
Yep. Did not see that in the doc at all. We're still trying to trace which pip install in our pipeline loaded your code. :-) I'll queue up some tasks to thread-safe this. Thanks for the info. |
I didn't deem it necessary to make this more explicit in the docs because I consider it good practice to assume a class is not thread-safe unless explicitly stated otherwise. Most classes in the Python standard library are not thread-safe, and don't bother to say so. Even plain old |
Sorry for the obfuscation, but IP and all that.
In the code below collectionCache is a TTLCache. I'm assigning a value into it and it is throwing a KeyError in your code. From the logic of your code, I can't see how this could ever happen. But we get it consistently. We're using python 2.7 and cachetools-1.1.6.
The text was updated successfully, but these errors were encountered: