-
Notifications
You must be signed in to change notification settings - Fork 20
Description
I wrote an multilingual fallback index for Plone plone.app.multilingualindexes. In order to get all items up to date, I need to cross-index objects. On unindex_object I need to reindex the same index of all objects in the same translation group. When doing so, for some reason (I did not figured out why) the for loop is reset:
Products.CMFCore/Products/CMFCore/indexing.py
Line 218 in 5bfac55
| for op, obj, attributes, metadata in self.queue: |
I have two items in the queue and the first item is processed twice (and then unindex fails).
I took the debugger and stepped through to verify this.
No idea how. I guess the iterator of self.queue was reset while unindex runs.
I then tried to work around the iterator reset - which results in this code:
while self.queue:
op, obj, attributes, metadata = self.queue.pop(0)And now all works fine.
I would really like to provide a pull request, but I first I want to understand what happens here. Also, I have no good idea how to write a test for this effect.
Is anyone here with more insights/ ideas?