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
cacheops fails at runtime on 4th version #264
Comments
Should be fixed now. BTW, CACHEOPS = {
'*.*': {}, # only manual caching
} Manual caching, which will be enabled after this, includes:
Another thing is that if you only cache queries to some models you should avoid using |
@Suor, so, you'll publish new version soon? About setting CACHEOPS_ENABLED - yeah, I know, I just forgot to change it to True while pasting here after some experiments. Actually, I found another thing. When I add any settings to CACHEOPS (for example, |
What Django version you have? |
@Suor, oh, yeah, forgot to mention. |
Have no idea about clone thing. Do you have a stack trace? |
|
@Suor, great. |
@Suor, sadly, I found new things. don't know if it's just my problem, but I just share this observation with you. p.s. only manual caching was enabled. |
Looks like, you have some weird setup there) I used cacheops with celery and it worked fine. And the bug with |
@Suor, we went deeper...
We tried this simple fix:
and it helps, all tests works after that. So, you know better how the whole code works and if this fix is OK and won't be a reason for another bugs, then cool. P.S. But strange thing that when I tried to commit, list was empty, so exception raised. That leads us to rollback function, where list was already NOT empty. |
And as far as I understand, setting |
Are you changing |
@Suor, I set this only in base settings file and don't check or change it anywhere else. |
@Suor, and what do you think about that fix that checks if list is empty before trying to pop()? |
This is not a fix. It's a hack that avoids exception with unknown side effects like leaving the system in undefined state. |
|
@Suor, well, maybe it's a hack... but function calls |
As long as calls to |
I can only think of one scenario for now how those calls might not be paired - if cacheops is installed and patches |
@Suor, ok, I'll try to describe:
In this task I move objects of few tables to another DB (archive).
Then I just move and save everything.
So, on the last line that error appeared ( Hope this helps to understand what is the reason of this bug. |
So you have unpaired @shared_task
@transaction.atomic
@transaction.atomic(archive_alias)
def some_task(...):
# ... do your thing |
Also can you please post a full stack trace leading to |
@Suor, damn, you're right. Don't know why I went low level way. Anyway, here is the stack trace:
|
Not sure what should I do here. Error out with unpaired commit error? Warn? Skip silently? |
Closing for now |
@Suor, not sure that I correctly understand your question. |
If you do it paired then it should work, the issue was caused by an unpaired commit. |
Anyway those questions was not directed to you) |
Hello.
On cacheops 3.2.1 there is no runtime errors.
But after I upgrade to 4th version (I tried all four subversions), I get this error at runtime:
Settings are very easy:
Have no idea what's wrong here.
Anybody knows?
The text was updated successfully, but these errors were encountered: