-
-
Notifications
You must be signed in to change notification settings - Fork 284
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
count() issue when using instance_of() #134
Comments
Hi @Karmak23, First, is the issue recurrent or did it just happened once and never came back again? from django.db import connection
connection.queries = []
k.feeds.instance_of(MailFeed).count()
len(k.feeds.instance_of(MailFeed))
print(connection.queries) |
Interesting… The question raised by the concurrent write is “how the heck ?”. The mailfeed has been in the database for days. How can this be a concurrent write make it “disappear” temporarily from BTW, I ran your code and Thanks a lot, |
Are you using an ORM caching tool like django-cache-machine, django-cacheops, johnny-cache or django-cachalot? Could you run it again using |
Yes, well guessed, I use Given how long the count() returned 0, it seems very probable I'll will run it with DEBUG as soon as possible today, and most probably close this issue after reporting the result. Thanks a lot for your hints @BertrandBordage |
Don’t look further: django-cacheops and django-cache-machine rely a lot on timeout. They often return stale results and don’t handle ridiculously common queries, such as This issue can be closed in my opinion. |
… or multi-table inheritance for cacheops (Suor/django-cacheops#31), the exact reason why you’re experiencing this problem (since polymorphic is based on multi-table inheritance). |
Yep. |
Hi, I hit this strange behaviour:
MailFeed
is a child ofBaseFeed
. Obviously,count()
should return1
.The strangest thing is that it doesn't happen with another child class of the same level (
RssAtomFeed
, to name it) :Where should I head to find if the issue comes from my code or polymorphic ? Do you have any hint of what could cause this strange behavior ?
The text was updated successfully, but these errors were encountered: