From a5edbe0f79a8b9ccc392a50b4c12de334df70419 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Fri, 6 Jun 2014 12:46:27 +0100 Subject: [PATCH] Re: notmuch dump: taking write-lock to protect from concurrent (cronned) notmuch new? --- 70/9f109012abce924aab146ca554d4a8ac1319d2 | 113 ++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 70/9f109012abce924aab146ca554d4a8ac1319d2 diff --git a/70/9f109012abce924aab146ca554d4a8ac1319d2 b/70/9f109012abce924aab146ca554d4a8ac1319d2 new file mode 100644 index 000000000..ba97ffba5 --- /dev/null +++ b/70/9f109012abce924aab146ca554d4a8ac1319d2 @@ -0,0 +1,113 @@ +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 EF6CC40CAE3 + for ; Fri, 6 Jun 2014 04:46:43 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.502 +X-Spam-Level: +X-Spam-Status: No, score=0.502 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_LOW=-0.7] 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 GdMHJ8865UuJ for ; + Fri, 6 Jun 2014 04:46:36 -0700 (PDT) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 0B2ED40CAE2 + for ; Fri, 6 Jun 2014 04:46:35 -0700 (PDT) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1WssbN-0007J0-NT; Fri, 06 Jun 2014 12:46:29 +0100 +Received: from 5751dfa2.skybroadband.com ([87.81.223.162] helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) + (envelope-from ) + id 1WssbN-0001Ku-AU; Fri, 06 Jun 2014 12:46:29 +0100 +From: Mark Walters +To: Maarten Aertsen , notmuch@notmuchmail.org +Subject: Re: notmuch dump: taking write-lock to protect from concurrent + (cronned) notmuch new? +In-Reply-To: <20140606080354.28047.77393@kardo.rtsn.nl> +References: <20140606080354.28047.77393@kardo.rtsn.nl> +User-Agent: Notmuch/0.15.2+615~g78e3a93 (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Fri, 06 Jun 2014 12:46:27 +0100 +Message-ID: <878upafegc.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 87.81.223.162 +X-QM-Geographic: According to ripencc, + this message was delivered by a machine in Britain (UK) (GB). +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: a442bb71532a10330fab604b309f58c5 (of first 20000 bytes) +X-SpamAssassin-Score: -0.1 +X-SpamAssassin-SpamBar: / +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored -0.1 points. + Summary of the scoring: + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * -0.1 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +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: Fri, 06 Jun 2014 11:46:44 -0000 + + +On Fri, 06 Jun 2014, Maarten Aertsen wrote: +> Hi everyone, +> +> (summary of IRC-conversation just now) +> I did: +> - run notmuch new (and afew -t) in cron, every two minutes +> - run notmuch dump in cron, every 12 hours +> +> I expected: +> - notmuch dump to complete, possibly causing notmuch new to fail in the meantime +> +> I observed: +> - notmuch dump terminating with: +> "terminate called after throwing an instance of 'Xapian::DatabaseModifiedError'" +> +> mjw1009 suggested to change NOTMUCH_DATABASE_MODE_READ_ONLY on line +> 215 of notmuch-dump.c to NOTMUCH_DATABASE_MODE_READ_WRITE +> +> I'm wondering if this hits enough people to motivate the addition of a +> command line switch (or perhaps even a change in default behaviour?) + +I think this is a clear bug but the fix is a little unclear. The above +fix works but it breaks one of the tests: "unicode message-ids" in +T150-tagging.sh. + +I think the problem is that it does +notmuch dump | sed... | notmuch restore + +and if we open the dump read-write the restore will fail. + +We can obviously fix the test, but I don't know if anyone is using a +pipe of this sort in their scripts. If this a likely problem then we +could offer a --no-lock option (which keeps the behaviour as now) + +What do people think? + +Best wishes + +Mark + -- 2.26.2