It looks like the following is triggering this problem (a clasical race condition):
- a update() operation from the backend (reload, enable channel) triggers a apt-xapian-index update with --update
- when the update is finished, a cache-ready signal is emited, that causes the various views to be refreshed
- during this refresh the gtk event loop keeps running to keep the UI alive
- when apt-xapian-index finishes, it reopens the DB
- if the a-x-i update finishes quicker than the refresh triggered by the cache update finishes (its runs with --update so that can happen) then it can be in the middle of a "for m in self.xapiandb.postlist() operation. at this point the returned iterators are no longer valid because the DB got reopenend and xapian detects that (the iterators are for the previous generation of the DB)
It looks like the following is triggering this problem (a clasical race condition):
- a update() operation from the backend (reload, enable channel) triggers a apt-xapian-index update with --update postlist( ) operation. at this point the returned iterators are no longer valid because the DB got reopenend and xapian detects that (the iterators are for the previous generation of the DB)
- when the update is finished, a cache-ready signal is emited, that causes the various views to be refreshed
- during this refresh the gtk event loop keeps running to keep the UI alive
- when apt-xapian-index finishes, it reopens the DB
- if the a-x-i update finishes quicker than the refresh triggered by the cache update finishes (its runs with --update so that can happen) then it can be in the middle of a "for m in self.xapiandb.