From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Wed, 29 Feb 2012 09:19:16 +0000 (+0100) Subject: fix notmuch_database_close X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=360e612979cbdf8405078632856d4983c262eb1d;p=notmuch-archives.git fix notmuch_database_close --- diff --git a/7e/f5d3c772245114f733b461a60e6e639e6301a8 b/7e/f5d3c772245114f733b461a60e6e639e6301a8 new file mode 100644 index 000000000..f36157c5f --- /dev/null +++ b/7e/f5d3c772245114f733b461a60e6e639e6301a8 @@ -0,0 +1,80 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 72EA5431FD4 + for ; Wed, 29 Feb 2012 01:19:29 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id d31O1MgM-jYF for ; + Wed, 29 Feb 2012 01:19:28 -0800 (PST) +Received: from mail.cryptobitch.de (cryptobitch.de [88.198.7.68]) + (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id E5AEF431FAF + for ; Wed, 29 Feb 2012 01:19:27 -0800 (PST) +Received: from mail.jade-hamburg.de (unknown [85.183.11.228]) + (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.cryptobitch.de (Postfix) with ESMTPSA id 173ED4F2EBE + for ; Wed, 29 Feb 2012 10:19:26 +0100 (CET) +Received: by mail.jade-hamburg.de (Postfix, from userid 401) + id F1A6EDF2A7; Wed, 29 Feb 2012 10:19:23 +0100 (CET) +Received: from thinkbox.jade-hamburg.de (unknown [10.1.1.153]) + (using TLSv1 with cipher AES256-SHA (256/256 bits)) + (No client certificate requested) (Authenticated sender: teythoon) + by mail.jade-hamburg.de (Postfix) with ESMTPSA id 49CE7DF2A2 + for ; Wed, 29 Feb 2012 10:19:23 +0100 (CET) +Received: from teythoon by thinkbox.jade-hamburg.de with local (Exim 4.77) + (envelope-from ) + id 1S2fgw-00068P-Ed + for notmuch@notmuchmail.org; Wed, 29 Feb 2012 10:19:22 +0100 +From: Justus Winter <4winter@informatik.uni-hamburg.de> +To: notmuch@notmuchmail.org +Subject: fix notmuch_database_close +Date: Wed, 29 Feb 2012 10:19:16 +0100 +Message-Id: + <1330507157-22859-1-git-send-email-4winter@informatik.uni-hamburg.de> +X-Mailer: git-send-email 1.7.9 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 29 Feb 2012 09:19:29 -0000 + +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 +