fix notmuch_database_close

Justus Winter 4winter at informatik.uni-hamburg.de
Wed Feb 29 01:19:16 PST 2012


Pazz mentioned a problem wrt reopening a notmuch database immediately
after it has been closed. The problem can be reproduced with this test
case:

~~~ snip ~~~
import os
import notmuch

db_path = os.path.expanduser('~/Maildir')

for i in range(2):
    with notmuch.Database(db_path, mode=notmuch.Database.MODE.READ_WRITE) as db:
        query = db.create_query('tag:inbox AND NOT tag:killed')
        print(len(list(query.search_messages())))
~~~ snap ~~~

Without this fix, the second loop iteration fails because the xapian
lock is not released in time.

Cheers,
Justus



More information about the notmuch mailing list