1 Return-Path: <amdragon@mit.edu>
\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 74F7F431FAF
\r
6 for <notmuch@notmuchmail.org>; Sat, 21 Apr 2012 21:11:14 -0700 (PDT)
\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 1CWY6GUiW+Ma for <notmuch@notmuchmail.org>;
\r
16 Sat, 21 Apr 2012 21:11:13 -0700 (PDT)
\r
17 Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id 9BA20431FAE
\r
20 for <notmuch@notmuchmail.org>; Sat, 21 Apr 2012 21:11:13 -0700 (PDT)
\r
21 X-AuditID: 12074425-b7f4a6d0000008e0-50-4f9384e1b031
\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])
\r
23 by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 1A.8B.02272.1E4839F4; Sun, 22 Apr 2012 00:11:13 -0400 (EDT)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q3M4BCEV005381;
\r
27 Sun, 22 Apr 2012 00:11:13 -0400
\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])
\r
29 (authenticated bits=0)
\r
30 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
31 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q3M4BAas010145
\r
32 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
33 Sun, 22 Apr 2012 00:11:11 -0400 (EDT)
\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)
\r
35 (envelope-from <amdragon@mit.edu>)
\r
36 id 1SLo8k-0005Q9-7z; Sun, 22 Apr 2012 00:11:10 -0400
\r
37 Date: Sun, 22 Apr 2012 00:11:10 -0400
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: Mark Walters <markwalters1009@gmail.com>
\r
40 Subject: Re: [PATCH 1/3] new: Consistently treat fatal errors as fatal
\r
41 Message-ID: <20120422041109.GA17810@mit.edu>
\r
42 References: <1330357759-1337-1-git-send-email-amdragon@mit.edu>
\r
43 <1330357759-1337-2-git-send-email-amdragon@mit.edu>
\r
44 <87zkab4qs9.fsf@qmul.ac.uk>
\r
46 Content-Type: text/plain; charset=us-ascii
\r
47 Content-Disposition: inline
\r
48 In-Reply-To: <87zkab4qs9.fsf@qmul.ac.uk>
\r
49 User-Agent: Mutt/1.5.21 (2010-09-15)
\r
50 X-Brightmail-Tracker:
\r
51 H4sIAAAAAAAAA+NgFmpmleLIzCtJLcpLzFFi42IR4hRV1n3YMtnfYOZMNovVc3ksrt+cyezA
\r
52 5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZWyYMoGx4LNMRf/GW2wNjP9Euxg5OSQETCQ2
\r
53 rtjDCmGLSVy4t56ti5GLQ0hgH6PE9TvrWCCcDYwSiy+2MUE4J5kkth1cwwrhLGGU2Hf/NFAZ
\r
54 BweLgKpEyyw/kFFsAhoS2/YvZwSxRQR0JG4fWsAOYjMLSEt8+93MBGILC7hJzJ+xmRnE5gWq
\r
55 uXH0CSPEzMmMEofmnodKCEqcnPmEBaJZS+LGv5dMILtABi3/xwES5gTatX3zbDYQW1RARWLK
\r
56 yW1sExiFZiHpnoWkexZC9wJG5lWMsim5Vbq5iZk5xanJusXJiXl5qUW6Fnq5mSV6qSmlmxhB
\r
57 Yc3uorqDccIhpUOMAhyMSjy8L00m+wuxJpYVV+YeYpTkYFIS5dWvBArxJeWnVGYkFmfEF5Xm
\r
58 pBYfYpTgYFYS4f0sApTjTUmsrEotyodJSXOwKInzamq98xMSSE8sSc1OTS1ILYLJynBwKEnw
\r
59 egLjV0iwKDU9tSItM6cEIc3EwQkynAdo+OtmkOHFBYm5xZnpEPlTjIpS4ryRIM0CIImM0jy4
\r
60 XljaecUoDvSKMK8RSBUPMGXBdb8CGswENDghZhLI4JJEhJRUA2PpxQeTD62YPcH4i9Qu9zMb
\r
61 /Sd+P3f48FFN0eMXG1iPTZ3Fuk0/RVd7rW5Adta+5d65Fm+qw6uftN6davFR68HvnQ6Sa1vc
\r
62 a/kdHjfcfbTgdcd1bW+pfxvDebatbf74tFbap1nRmO3r1RdpndkbkxUWyHzYqv7IcnKg033x
\r
63 TXxMTVKXNv78Y+SqxFKckWioxVxUnAgAsTYadRYDAAA=
\r
64 Cc: notmuch@notmuchmail.org
\r
65 X-BeenThere: notmuch@notmuchmail.org
\r
66 X-Mailman-Version: 2.1.13
\r
68 List-Id: "Use and development of the notmuch mail system."
\r
69 <notmuch.notmuchmail.org>
\r
70 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
71 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
72 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
73 List-Post: <mailto:notmuch@notmuchmail.org>
\r
74 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
75 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
76 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
77 X-List-Received-Date: Sun, 22 Apr 2012 04:11:14 -0000
\r
79 Quoth Mark Walters on Apr 16 at 4:53 pm:
\r
81 > On Mon, 27 Feb 2012, Austin Clements <amdragon@MIT.EDU> wrote:
\r
82 > > Previously, fatal errors in add_files_recursive were not treated as
\r
83 > > fatal by its callers (including itself!) and add_files_recursive
\r
84 > > sometimes returned errors on non-fatal conditions. This makes
\r
85 > > add_files_recursive errors consistently fatal and updates all callers
\r
86 > > to treat them as fatal.
\r
88 > Hi I have attempted to review this but am feeling a little out of my
\r
89 > depth. This patch seems fine except for one thing I am unsure about:
\r
92 > > notmuch-new.c | 13 ++++++++-----
\r
93 > > 1 files changed, 8 insertions(+), 5 deletions(-)
\r
95 > > diff --git a/notmuch-new.c b/notmuch-new.c
\r
96 > > index 4f13535..bd9786a 100644
\r
97 > > --- a/notmuch-new.c
\r
98 > > +++ b/notmuch-new.c
\r
99 > > @@ -308,7 +308,6 @@ add_files_recursive (notmuch_database_t *notmuch,
\r
100 > > if (num_fs_entries == -1) {
\r
101 > > fprintf (stderr, "Error opening directory %s: %s\n",
\r
102 > > path, strerror (errno));
\r
103 > > - ret = NOTMUCH_STATUS_FILE_ERROR;
\r
108 > If I understand this, then this change makes a failure to open a
\r
109 > directory non-fatal. In the comment before the function it says
\r
111 > * Also, we don't immediately act on file/directory removal since we
\r
112 > * must ensure that in the case of a rename that the new filename is
\r
113 > * added before the old filename is removed, (so that no information
\r
114 > * is lost from the database).
\r
116 > I am worried that we could fail to find some files because of the
\r
117 > file error above, and then we delete them from the database. Maybe this
\r
118 > could only happen if those emails have just been moved to this
\r
119 > file-error directory?
\r
121 Hmm. This won't *actively* remove files, since that only happens if
\r
122 we successfully scan a directory and find a message that's in the
\r
123 database but not in that directory (*not* scanning the directory won't
\r
124 add anything to the remove list). However, you are right that if a
\r
125 message is moved from some other directory into a directory that we
\r
126 fail to open, that message will be deleted "by omission".
\r
128 I've added the error back, along with a comment explaining it.
\r
134 > > @@ -351,8 +350,10 @@ add_files_recursive (notmuch_database_t *notmuch,
\r
136 > > next = talloc_asprintf (notmuch, "%s/%s", path, entry->d_name);
\r
137 > > status = add_files_recursive (notmuch, next, state);
\r
138 > > - if (status && ret == NOTMUCH_STATUS_SUCCESS)
\r
139 > > + if (status) {
\r
143 > > talloc_free (next);
\r
146 > > @@ -933,6 +934,8 @@ notmuch_new_command (void *ctx, int argc, char *argv[])
\r
149 > > ret = add_files (notmuch, db_path, &add_files_state);
\r
153 > > gettimeofday (&tv_start, NULL);
\r
154 > > for (f = add_files_state.removed_files->head; f && !interrupted; f = f->next) {
\r
155 > > @@ -965,6 +968,7 @@ notmuch_new_command (void *ctx, int argc, char *argv[])
\r
160 > > talloc_free (add_files_state.removed_files);
\r
161 > > talloc_free (add_files_state.removed_directories);
\r
162 > > talloc_free (add_files_state.directory_mtimes);
\r
163 > > @@ -1012,10 +1016,9 @@ notmuch_new_command (void *ctx, int argc, char *argv[])
\r
168 > > - printf ("\nNote: At least one error was encountered: %s\n",
\r
170 > > + printf ("\nNote: A fatal error was encountered: %s\n",
\r
171 > > notmuch_status_to_string (ret));
\r
174 > > notmuch_database_close (notmuch);
\r