Re: [notmuch] [PATCH] Store documents for message-ids we haven't seen
authorCarl Worth <cworth@cworth.org>
Mon, 21 Dec 2009 18:43:16 +0000 (10:43 +1600)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:55 +0000 (09:35 -0800)
a3/878ba60ed2c2b28451ffee6df1b9964fd02586 [new file with mode: 0644]

diff --git a/a3/878ba60ed2c2b28451ffee6df1b9964fd02586 b/a3/878ba60ed2c2b28451ffee6df1b9964fd02586
new file mode 100644 (file)
index 0000000..f2b05bd
--- /dev/null
@@ -0,0 +1,86 @@
+Return-Path: <cworth@cworth.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 80B39431FBD;\r
+       Mon, 21 Dec 2009 10:43:17 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 3JKw+NUQCsJG; Mon, 21 Dec 2009 10:43:16 -0800 (PST)\r
+Received: from yoom.home.cworth.org (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id D1D43431FAE;\r
+       Mon, 21 Dec 2009 10:43:16 -0800 (PST)\r
+Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
+       id 889A8254306; Mon, 21 Dec 2009 10:43:16 -0800 (PST)\r
+From: Carl Worth <cworth@cworth.org>\r
+To: James Westby <jw+debian@jameswestby.net>, notmuch@notmuchmail.org\r
+In-Reply-To: <1261340852-20183-1-git-send-email-jw+debian@jameswestby.net>\r
+References: <871virzzjy.fsf@yoom.home.cworth.org>\r
+       <1261340852-20183-1-git-send-email-jw+debian@jameswestby.net>\r
+Date: Mon, 21 Dec 2009 10:43:16 -0800\r
+Message-ID: <87tyvknp6j.fsf@yoom.home.cworth.org>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha1; protocol="application/pgp-signature"\r
+Subject: Re: [notmuch] [PATCH] Store documents for message-ids we haven't\r
+       seen\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.12\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 21 Dec 2009 18:43:17 -0000\r
+\r
+--=-=-=\r
+\r
+On Sun, 20 Dec 2009 20:27:32 +0000, James Westby <jw+debian@jameswestby.net> wrote:\r
+>   One case that isn't handled is when we don't find the thread\r
+>   id of the parent, but then find the message itself. I believe\r
+>   this case shouldn't happen, but you never know.\r
+\r
+It really shouldn't happen since we are holding a write lock on the\r
+database, (so there's no possible race condition here with another\r
+client delivering the parent message).\r
+\r
+But since you almost can't help but detect the case, (just noticing a\r
+NOTMUCH_STATUS_SUCCESS value from _create_for_message_id), please put an\r
+INTERNAL_ERROR there rather than marching along with an incorrect thread\r
+ID.\r
+\r
+> +        // We have yet to see the referenced message, generate a thread id\r
+> +        // for it if needed and store a dummy message for the parent. If we\r
+> +        // find the mail later we will replace the dummy.\r
+\r
+Call me old-fashioned if you will, but I'd much rather have C style\r
+multi-line comments (/* ... */) rather than these C++-style comments\r
+with //.\r
+\r
+> +                if (private_status == NOTMUCH_PRIVATE_STATUS_NO_DOCUMENT_FOUND) {\r
+> +                    // expected\r
+\r
+And I think this comment deserves a complete sentence before the\r
+condition. Something like:\r
+\r
+/* We expect this call to create a new document (return NO_DOCUMENT_FOUND) */\r
+\r
+-Carl\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.10 (GNU/Linux)\r
+\r
+iD8DBQFLL8HE6JDdNq8qSWgRApiyAJoD4RgwIvKAw76GZsXQXQtjSJAnswCgnAHd\r
+NDrxx6eQxvZ9QVLjgVLq2ag=\r
+=NK5e\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r