1 Return-Path: <jani@nikula.org>
\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 olra.theworths.org (Postfix) with ESMTP id 0C95D431FC4
\r
6 for <notmuch@notmuchmail.org>; Thu, 14 Nov 2013 06:13:51 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id kkIJaMV5eigk for <notmuch@notmuchmail.org>;
\r
16 Thu, 14 Nov 2013 06:13:43 -0800 (PST)
\r
17 Received: from mail-we0-f179.google.com (mail-we0-f179.google.com
\r
18 [74.125.82.179]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 628A9431FB6
\r
21 for <notmuch@notmuchmail.org>; Thu, 14 Nov 2013 06:13:43 -0800 (PST)
\r
22 Received: by mail-we0-f179.google.com with SMTP id x55so1979632wes.38
\r
23 for <notmuch@notmuchmail.org>; Thu, 14 Nov 2013 06:13:42 -0800 (PST)
\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
25 d=1e100.net; s=20130820;
\r
26 h=x-gm-message-state:from:to:cc:subject:in-reply-to:references
\r
27 :user-agent:date:message-id:mime-version:content-type;
\r
28 bh=d5XhcYFpOR8ALgBzeY07/d9sZ9uB0ZGDrV5X0B3O2AY=;
\r
29 b=BqriVgFvLAHrIjcByGhmfPlIDi+/naHwFTMd/qEDKxol2sNKKzM68P01t29olDA6Qq
\r
30 S5sMMHxihIvY9YWeSfhWlA0Kz1+AA/yp661g6YhsVvCJPTMPHrWJWCb7Yc8e4V2CwPTg
\r
31 D15zvoM6AdNTBVsO30MBlZIiBXLsVNROwyr5T4+7TAWZ9nnruiTYpODixMZ0KvpTbh3V
\r
32 vEvwIV3BGgJK+DbjllqtcU98R67z+lW8CrPAjvoL4+1r7T2kydJ1Sr5oLOvPH1eBVgJA
\r
33 5y/lru6d38xHNadFre50FwxbAiQOz/S6gPM0X9NWHr3OLDKsq1Lmevi87T1EFs5EuGa2
\r
36 ALoCoQm88QTY/kjQ5fB52dKmEPLsqIm5S/l6PQjWwOdTMFw7RKcSaH5JZ7GpfoI0FCvJ/yrJnKOM
\r
37 X-Received: by 10.180.39.238 with SMTP id s14mr2949815wik.60.1384438422023;
\r
38 Thu, 14 Nov 2013 06:13:42 -0800 (PST)
\r
39 Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3])
\r
40 by mx.google.com with ESMTPSA id
\r
41 uc12sm14290859wib.3.2013.11.14.06.13.40 for <multiple recipients>
\r
42 (version=TLSv1.1 cipher=RC4-SHA bits=128/128);
\r
43 Thu, 14 Nov 2013 06:13:41 -0800 (PST)
\r
44 From: Jani Nikula <jani@nikula.org>
\r
45 To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org
\r
46 Subject: Re: [PATCH v2 5/5] compact: provide user more information on
\r
47 after-compaction failures
\r
48 In-Reply-To: <1384362167-12740-6-git-send-email-tomi.ollila@iki.fi>
\r
49 References: <1384362167-12740-1-git-send-email-tomi.ollila@iki.fi>
\r
50 <1384362167-12740-6-git-send-email-tomi.ollila@iki.fi>
\r
51 User-Agent: Notmuch/0.16+115~gd647c65 (http://notmuchmail.org) Emacs/23.2.1
\r
52 (x86_64-pc-linux-gnu)
\r
53 Date: Thu, 14 Nov 2013 15:13:25 +0100
\r
54 Message-ID: <871u2jnkai.fsf@nikula.org>
\r
56 Content-Type: text/plain; charset=us-ascii
\r
57 Cc: tomi.ollila@iki.fi
\r
58 X-BeenThere: notmuch@notmuchmail.org
\r
59 X-Mailman-Version: 2.1.13
\r
61 List-Id: "Use and development of the notmuch mail system."
\r
62 <notmuch.notmuchmail.org>
\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
64 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
66 List-Post: <mailto:notmuch@notmuchmail.org>
\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
69 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
70 X-List-Received-Date: Thu, 14 Nov 2013 14:13:51 -0000
\r
72 On Wed, 13 Nov 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:
\r
73 > After database has been compacted, there are steps to put the new
\r
74 > database into place -- and these steps may fail. In case such
\r
75 > failure happens, provide better information how to resolve it.
\r
77 I disagree with having a library spew all this information out. For each
\r
78 case, I think it should be sufficient to just say what happened
\r
79 (e.g. "rename a -> b failed" + strerror). I don't think a library's
\r
80 error messages should be a tutorial on how to fix things.
\r
82 We may need to amend notmuch compact man page though.
\r
90 > Thanks to Ben Gamari for most of the information content.
\r
92 > lib/database.cc | 39 +++++++++++++++++++++++++++++++++++----
\r
93 > 1 file changed, 35 insertions(+), 4 deletions(-)
\r
95 > diff --git a/lib/database.cc b/lib/database.cc
\r
96 > index 4b5ac64..a6daac6 100644
\r
97 > --- a/lib/database.cc
\r
98 > +++ b/lib/database.cc
\r
99 > @@ -939,19 +939,50 @@ notmuch_database_compact (const char *path,
\r
102 > if (rename (xapian_path, backup_path)) {
\r
103 > - fprintf (stderr, "Error moving old database out of the way\n");
\r
104 > + fprintf (stderr, "Error moving old database out of the way:\n"
\r
105 > + "Old database: %s\n"
\r
106 > + "Backup database: %s\n"
\r
107 > + "Error: %s\n", xapian_path, backup_path, strerror (errno));
\r
108 > ret = NOTMUCH_STATUS_FILE_ERROR;
\r
112 > if (rename (compact_xapian_path, xapian_path)) {
\r
113 > - fprintf (stderr, "Error moving compacted database\n");
\r
114 > + fprintf (stderr, "Error moving compacted database into place: %s\n",
\r
115 > + strerror (errno));
\r
116 > + fprintf (stderr, "\n"
\r
117 > + "Encountered error while moving the compacted database\n"
\r
125 > + "Please identify the reason for this and move the compacted database\n"
\r
126 > + "into place manually.\n"
\r
128 > + "Alternatively you can revert to the uncompacted database with\n"
\r
130 > + " mv '%s' '%s'\n"
\r
131 > + "\n", compact_xapian_path, xapian_path,
\r
132 > + backup_path, xapian_path);
\r
133 > ret = NOTMUCH_STATUS_FILE_ERROR;
\r
137 > - if (! keep_backup)
\r
138 > - rmtree (backup_path);
\r
139 > + if (! keep_backup) {
\r
140 > + if (rmtree (backup_path)) {
\r
141 > + fprintf (stderr, "Error removing backup database: %s\n",
\r
142 > + strerror (errno));
\r
143 > + fprintf (stderr, "\n"
\r
144 > + "Please remove the backup database with\n"
\r
146 > + " rm -rf '%s'\n" "\n", backup_path);
\r
147 > + ret = NOTMUCH_STATUS_FILE_ERROR;
\r
157 > _______________________________________________
\r
158 > notmuch mailing list
\r
159 > notmuch@notmuchmail.org
\r
160 > http://notmuchmail.org/mailman/listinfo/notmuch
\r