-
Notifications
You must be signed in to change notification settings - Fork 22
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
Stale cached results after clearing catalog index #19
Comments
Sorry for being inactive on ZCatalog. I spent my free time on Zope itself lately. I'll take a look once I'm back from a conference in a week. Unless someone else wants to volunteer before that :) |
Code change in previous cherry-picked commit.
I've cherry-picked the commit to master and the 3.x branch. I'll leave this open until I cut a 3.2.1 release. I'll do that once the current Zope sprint in Innsbruck is over, to not interfere with the sprinters work. |
ZCatalog 3.2.1 is up on PyPi for a while now. |
An index's counter is used as part of its cache key in the request cache that was added in version 3.2. Clearing an index resets the counter, but it doesn't clear the request cache. As a result, queries after clearing the index may get stale results that were cached before the index was cleared.
This is causing a failure in at least one Plone test that does query when there is no content (counter = 0), then adds content and queries (counter = 1), clears and rebuilds the catalog (counter = 0), and does the query again (counter = 0 so gets the cached results, which are missing the content item that was added and still exists).
/cc @andbag
The text was updated successfully, but these errors were encountered: