-
Notifications
You must be signed in to change notification settings - Fork 19
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
cache semantics are wrong on PyPy #29
Comments
|
I believe the sequence of events is as follows. Item A is loaded, with All strong references to A are lost. It is garbage collected. However, since PyPy defers execution of weakref callbacks, its entry remains in the cache. Item A-prime is loaded, with Now, PyPy sees fit to invoke A's weakref callback. It deletes Item A-prime-prime is now loaded, with Everything goes downhill quickly from there. |
|
It may be possible to reproduce this issue on CPython. The sequence of events would require having a second weakref to an item, with a weakref callback that causes the item to be reloaded from the database, and for that weakref callback to run before the one in However, this is a scenario that is unlikely to occur in user code, and I have not yet verified that the reproduction is actually possible. |
|
In any case, I believe the fix would be right for that scenario too :). |
I have not managed to reproduce this in isolation outside the context of twisted/imaginary#64 just yet, but I believe I'm seeing Item instances with the same
storeIDfor the samestoreexisting at the same time.Superficially it appears that the weakref to an object returns
Nonewhile there are still strong references held elsewhere in the program. I feel like I must be wrong about that though.The text was updated successfully, but these errors were encountered: