From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id UvBDNeBO514qUQAA0tVLHw (envelope-from ) for ; Mon, 15 Jun 2020 10:35:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id iHYCMeBO517CQAAA1q6Kng (envelope-from ) for ; Mon, 15 Jun 2020 10:35:12 +0000 Received: from arlo.cworth.org (arlo.cworth.org [50.126.95.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 56948940AF4 for ; Mon, 15 Jun 2020 10:35:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 7EEBE6DE0ABA; Mon, 15 Jun 2020 03:35:06 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id URu-rsRBTF3p; Mon, 15 Jun 2020 03:35:05 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id 3B6986DE0EC6; Mon, 15 Jun 2020 03:35:05 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 40AC96DE0EC6 for ; Mon, 15 Jun 2020 03:35:04 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AU_rMQPKT8t7 for ; Mon, 15 Jun 2020 03:35:03 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 469816DE0ABA for ; Mon, 15 Jun 2020 03:35:03 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.92) (envelope-from ) id 1jkmSE-0001jm-B4; Mon, 15 Jun 2020 06:35:02 -0400 Received: (nullmailer pid 597158 invoked by uid 1000); Mon, 15 Jun 2020 10:35:00 -0000 From: David Bremner To: Floris Bruynooghe , notmuch@notmuchmail.org Subject: Re: [PATCH] Support aborting the atomic context In-Reply-To: <20200614152319.57064-1-flub@devork.be> References: <20200614152319.57064-1-flub@devork.be> Date: Mon, 15 Jun 2020 07:35:00 -0300 Message-ID: <87a714y5uz.fsf@tethera.net> MIME-Version: 1.0 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: notmuch-bounces@notmuchmail.org Sender: "notmuch" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 50.126.95.6 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: -1.01 X-TUID: vBXutC2kX6kK Floris Bruynooghe writes: > This is an implementation of what was suggested in > id:87v9k96xtl.fsf@powell.devork.be It closes the database as that is > the only safe way to do this afaik. > > Currently when the database is closed there are still a bunch of > operations which can result in segfaults. Yet the API also promises > that some operations are still valid, basically those which only > access already previously retrieved information. It would be nice to > find a good solution for this in the python bindings, but I don't yet > know what this would be. There is a Xapian method WritableDatabase::cancel_transaction(), but it is not currently exposed by notmuch. I think it could be added, but getting the testing working right is not something I want to tackle at this point in the release cycle. I guess this should be upwardly compatible, as all code correct for your current implementation should still work if we replace notmuch_database_close with notmuch_cancel_atomic. Thoughts? d