--- /dev/null
+Return-Path: <eg@gaute.vetsj.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id AEC396DE0924\r
+ for <notmuch@notmuchmail.org>; Sun, 28 Feb 2016 04:32:56 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.468\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.468 tagged_above=-999 required=5 tests=[AWL=0.252,\r
+ DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7,\r
+ RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id rJ0iI7U4Vkln for <notmuch@notmuchmail.org>;\r
+ Sun, 28 Feb 2016 04:32:54 -0800 (PST)\r
+Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com\r
+ [209.85.215.49])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id A87FA6DE00DF\r
+ for <notmuch@notmuchmail.org>; Sun, 28 Feb 2016 04:32:53 -0800 (PST)\r
+Received: by mail-lf0-f49.google.com with SMTP id m1so76641930lfg.0\r
+ for <notmuch@notmuchmail.org>; Sun, 28 Feb 2016 04:32:53 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=gaute-vetsj-com.20150623.gappssmtp.com; s=20150623;\r
+ h=date:from:subject:to:references:in-reply-to:user-agent:message-id\r
+ :mime-version:content-transfer-encoding;\r
+ bh=NYKPKjKEkcPieDZ89dXiUbu1RNkbVqY7xq8fRbvtQAw=;\r
+ b=lvHqDhUKIzv9QbRkgfxJ2hK1oSmAZTKCE8Ljfzv49MSeoJgqa/bVPLRwl5YTh8eReH\r
+ SNAHy8fT/0jmmNylO2rFg6IDyizinogTsqnRDuaRJWQLo7AmpbrXj0jIh2rR1pxb5Ado\r
+ BW3wtE7oyqsQWZPmEYgao74yl/2ayWd393d+o18q6XvzpdtTzJNRycRSEevX4mSJrV6o\r
+ x9OEeucVvjdJ4tMX3v00ijhS28lc48jA1lOEWEg5ek8o1jkAeTGQMq383jO5f6TjGsub\r
+ 5ycLv7Pm+UpdfPbCZgohGyd87QHIrkh7M+usa929wK0eHY2JydDa49UcI4ppOjpg7WoO\r
+ MOiQ==\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:date:from:subject:to:references:in-reply-to\r
+ :user-agent:message-id:mime-version:content-transfer-encoding;\r
+ bh=NYKPKjKEkcPieDZ89dXiUbu1RNkbVqY7xq8fRbvtQAw=;\r
+ b=NNmonmF2pdk3GSPYZ9UZJiiHAXZBrfvAoX7iY60sYHXNOJKe9oSyyhVBqBZvpztCRw\r
+ Z5Gwe4ZHRa2RMEheOEQ6A82lcwpa7BRwN0N0KJq93zKMXAND6iPeICEDbiOu85/naACG\r
+ SosZQZomgUdXP5TJTgWRqrgj5zzBmyt2Ot0TbACCaZrVsqy5mjCNBd8mUqOgVypuJk3s\r
+ +hQtA2bUgtLbOT4Q4110NL3pF8qbdtNbZwhzWh2K3CGGKKDbeg3m9B72EsfbRCtQ3o7m\r
+ FQBYofrLc5r9xSUUDxD5LETw2p9tzJ+LgdK9nyfQFGtJOgwgO6yxf4iLRwTIvf6m5UZW\r
+ UwIQ==\r
+X-Gm-Message-State:\r
+ AD7BkJLZ+FgTDxawuzmSBQ2aXvUFKKOgi7YpGvUWQFyCU5pN9R+8trLBWSFfHV7kTW5Lag==\r
+X-Received: by 10.25.144.12 with SMTP id s12mr3830130lfd.114.1456662770212;\r
+ Sun, 28 Feb 2016 04:32:50 -0800 (PST)\r
+Received: from localhost (c6878BF51.dhcp.as2116.net. [81.191.120.104])\r
+ by smtp.gmail.com with ESMTPSA id xf10sm3136470lbb.23.2016.02.28.04.32.47\r
+ (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Sun, 28 Feb 2016 04:32:48 -0800 (PST)\r
+Date: Sun, 28 Feb 2016 12:32:46 +0000\r
+From: Gaute Hope <eg@gaute.vetsj.com>\r
+Subject: Re: how do the different frontends deal with displaying large\r
+ queries?\r
+To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
+References: <1456296267-astroid-0-gqidxpyulu-23762@strange>\r
+ <87ziuqj8xl.fsf@tesseract.cs.unb.ca>\r
+ <1456487129-astroid-1-zemv9qfkbh-18628@strange>\r
+ <877fhq5ncl.fsf@zancas.localnet>\r
+In-Reply-To: <877fhq5ncl.fsf@zancas.localnet>\r
+User-Agent: astroid/v0.5-71-g4efc3da1 (https://github.com/gauteh/astroid)\r
+Message-Id: <1456661143-astroid-1-q87qney5lk-1529@strange>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8; format=flowed\r
+Content-Transfer-Encoding: quoted-printable\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://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: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 28 Feb 2016 12:32:56 -0000\r
+\r
+David Bremner writes on February 27, 2016 13:50:\r
+> Gaute Hope <eg@gaute.vetsj.com> writes:\r
+>=20\r
+>>\r
+>> While loading the threads, if I make enough modifications to the\r
+>> database while the query is still loading (specifically 1: removing the\r
+>> unread tag from a thread, and 2: adding the unread tag to the same threa=\r
+d)\r
+>> apparently the query is invalidated in some way, and I get a hard crash\r
+>> in `notmuch_tags_get ()`.\r
+>>\r
+>> The thread in question has alreaday been loaded and is displayed.\r
+>>\r
+>> Do you deal with this issue in some way?\r
+>>\r
+>=20\r
+> I think we "deal with" it by not leaving the database open very\r
+> long. The query is dumped as s-expr by a seperate process. Or perhaps we\r
+> just aren't doing the same level of concurrent operations, I don't know.\r
+\r
+Neither do I, I load the threads in the background. But for a long query\r
+that takes a while. The database is only kept open for the duration it\r
+takes to load the threads in the query.\r
+\r
+How long is the db open? Would you notice if it crashed? I'm guessing\r
+the abort is triggered by an Xapian::ModifiedDatabase somewhere.\r
+\r
+I am only able to consistently reproduce the error if I change the tags\r
+of a thread not yet loaded, a (somewhat messy) test case is available\r
+here:\r
+\r
+https://github.com/gauteh/astroid/blob/ti-stateless-query/test/test_notmuch=\r
+_standalone.cc\r
+\r
+If nothing else, it demonstrates the difficulty of handling these\r
+exceptions in functions that don't yet catch them, since they could\r
+happen along many of the internal steps.\r
+\r
+Regards, Gaute\r
+\r
+=\r