1 Return-Path: <david@tethera.net>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by arlo.cworth.org (Postfix) with ESMTP id A76BF6DE0A7F
\r
6 for <notmuch@notmuchmail.org>; Mon, 8 Feb 2016 03:56:51 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=-0.308 tagged_above=-999 required=5 tests=[AWL=0.243,
\r
12 RP_MATCHES_RCVD=-0.55, SPF_PASS=-0.001] autolearn=disabled
\r
13 Received: from arlo.cworth.org ([127.0.0.1])
\r
14 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id wkJ8JvZGtL1F for <notmuch@notmuchmail.org>;
\r
16 Mon, 8 Feb 2016 03:56:49 -0800 (PST)
\r
17 Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])
\r
18 by arlo.cworth.org (Postfix) with ESMTPS id C98786DE0261
\r
19 for <notmuch@notmuchmail.org>; Mon, 8 Feb 2016 03:56:49 -0800 (PST)
\r
20 Received: from remotemail by fethera.tethera.net with local (Exim 4.84)
\r
21 (envelope-from <david@tethera.net>)
\r
22 id 1aSkQJ-0007W9-1Q; Mon, 08 Feb 2016 06:56:07 -0500
\r
23 Received: (nullmailer pid 1006 invoked by uid 1000);
\r
24 Mon, 08 Feb 2016 11:56:46 -0000
\r
25 From: David Bremner <david@tethera.net>
\r
26 To: Maarten Aertsen <sagi-notmuch@rtsn.nl>,
\r
27 Notmuch Mail <notmuch@notmuchmail.org>
\r
28 Subject: Re: [PATCH] cli: avoid non-zero exits in notmuch insert --keep
\r
29 In-Reply-To: <20160207211340.15609.92485@kardo2.rtsn.nl>
\r
30 References: <20160124154800.19103.24730@kardo2.rtsn.nl>
\r
31 <87a8nsz8bd.fsf@zancas.localnet> <20160207211340.15609.92485@kardo2.rtsn.nl>
\r
32 User-Agent: Notmuch/0.21+5~gca076ce (http://notmuchmail.org) Emacs/24.5.1
\r
33 (x86_64-pc-linux-gnu)
\r
34 Date: Mon, 08 Feb 2016 07:56:45 -0400
\r
35 Message-ID: <87r3gn8lfm.fsf@maritornes.cs.unb.ca>
\r
37 Content-Type: text/plain
\r
38 X-BeenThere: notmuch@notmuchmail.org
\r
39 X-Mailman-Version: 2.1.20
\r
41 List-Id: "Use and development of the notmuch mail system."
\r
42 <notmuch.notmuchmail.org>
\r
43 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
46 List-Post: <mailto:notmuch@notmuchmail.org>
\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
48 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
50 X-List-Received-Date: Mon, 08 Feb 2016 11:56:51 -0000
\r
52 Maarten Aertsen <sagi-notmuch@rtsn.nl> writes:
\r
54 > In the case of any failure, we now return EX_TEMPFAIL (a sendmail
\r
55 > convention, defined in sysexits.h) to signal to the LDA that it should
\r
56 > retry later. This prevents a direct reject or bounce of e-mail.
\r
58 We talked a bit on IRC about the portability of sysexits.h. Afaik, it's
\r
59 available in GNU systems, on *BSD systems, and on OS/X. We can also
\r
60 borrow the gnulib copy if we need a compatability version.
\r
62 > +notmuch_bool_t notmuch_has_unmatched_db_uuid (notmuch_database_t *notmuch);
\r
63 > void notmuch_exit_if_unmatched_db_uuid (notmuch_database_t *notmuch);
\r
65 It's a bit unfortunate to end up with two such functions, but I guess we
\r
66 could migrate everything to has_unmatched_db_uuid. The double negative
\r
67 is a bit confusing too, it seems like it would be more natural to have a
\r
68 _has_matching_db_uuid
\r
69 > + status = notmuch_database_open (notmuch_config_get_database_path (config),
\r
70 > + NOTMUCH_DATABASE_MODE_READ_WRITE, ¬much);
\r
72 > + /* with keep, send EX_TEMPFAIL per sysexits.h to invite the caller to
\r
73 > + * retry at some later point and avoid permanent failure */
\r
74 > + if (notmuch_has_unmatched_db_uuid(notmuch))
\r
75 > + exit (keep ? EX_TEMPFAIL : EXIT_FAILURE);
\r
77 We're a bit fussy about spaces; see devel/STYLE
\r
79 I'd invite brainstorming about whether mismatched UUID is really a
\r
80 temporary failure. Unlike a lock, I don't see it going away without
\r
81 user/admin intervention. Actually, someone even specifying a UUID when
\r
82 calling notmuch insert would be a bit surprising.
\r
84 I suspect some of the tests in T070-insert.sh could/should be updated
\r
85 for changed exit values.
\r