From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id OKGxKX6Cm2CE3wAAgWs5BA (envelope-from ) for ; Wed, 12 May 2021 09:23:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 4GFSJX6Cm2DsQgAAB5/wlQ (envelope-from ) for ; Wed, 12 May 2021 07:23:42 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 602E82976A for ; Wed, 12 May 2021 09:23:42 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 58D8527180; Wed, 12 May 2021 03:23:34 -0400 (EDT) Received: from mailproxy04.manitu.net (mailproxy04.manitu.net [217.11.48.68]) by mail.notmuchmail.org (Postfix) with ESMTPS id 9AF4E20017 for ; Wed, 12 May 2021 03:23:31 -0400 (EDT) Received: from localhost (200116b8605ca20012b0ea84d94bc93e.dip.versatel-1u1.de [IPv6:2001:16b8:605c:a200:12b0:ea84:d94b:c93e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: michael@grubix.eu) by mailproxy04.manitu.net (Postfix) with ESMTPSA id BB2278048D; Wed, 12 May 2021 09:23:16 +0200 (CEST) MIME-Version: 1.0 In-Reply-To: <87fsyshpc6.fsf@tethera.net> References: <162076424929.3234.3999254277296434834.git@grubix.eu> <87fsyshpc6.fsf@tethera.net> Subject: Re: [PATCH] test: change database from within pre-new hook From: Michael J Gruber To: David Bremner , notmuch@notmuchmail.org Message-ID: <162080419530.6226.1085165083385413134.git@grubix.eu> Date: Wed, 12 May 2021 09:23:15 +0200 User-Agent: alot/0.9.1 Message-ID-Hash: GY2OOM4J4VAKQP5E4NQ7MRO5W5DSIFZB X-Message-ID-Hash: GY2OOM4J4VAKQP5E4NQ7MRO5W5DSIFZB X-MailFrom: michael@grubix.eu X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620804222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=UIaeBo35NHNalJ+4WpTgKdy5MXioEKh6EYV/i2tfOWY=; b=RoNycja/g1jRjMvyGUwAppxN+bkcWoY0ebw07jGp3cVrQL0avWPQqs4mcEQ0Vh3hfI8VGq osdiELk3HpGqCl+5k49j5sltTsVEL545den2f4GAla3KvKM97YK2gLu1/IaRQnwH1dDMl8 60ROgMEWdBkJOSPIyrwLPsesO7CGj0rMGAp/tTiDmCT+9dSoU2AlyCun9RVFd5cDTaMWYP 7EaL76Ja3+Z9hfDbebKFMdo7kKK4dZy5hACHnynoMBl5LcD+tPSQI+405tUQI6ESMnYEmK PJE78xBG6Z8macUyFcqdTtTUO9I9WaqczNCCEESSCUdrNpu+HY4/JOFPHOOSww== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620804222; a=rsa-sha256; cv=none; b=AjIVbKcCb+KRaMN7tpkw/Ekv+30LCvZSp09RvZcY1xIML4cspgNhKpXeeJsyc2PdtaSsBZ Cgm4Rp9RUOg4nOd9uQOI/uIVxcEobaW6DqAmmLWamMS+Mj+H+DcKy1PIID09BXReHxaGh6 u7aKrzGFHlNMzGCPA6ZSIewb5fHcIlTcehb35L+6fsqUbbPgYJjr9Kp7FmGBvqtcYPPTdM jeSp3ROkYy8P/nKTXGjqTAOJVffOm8b0nA9md+JOTH+GhkU8tzMFSOolAO4pdS/xnLRWgp 6mqkm5HKBO/8pLpKzkTjCdxHs3NC7io0u6bm1hSaEQYkZRfLIpUZTYTJ+IurYw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.03 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 602E82976A X-Spam-Score: -1.03 X-Migadu-Scanner: scn0.migadu.com X-TUID: jdzd8wAG8S1K David Bremner venit, vidit, dixit 2021-05-12 00:34:33: > Michael J Gruber writes: > > > Due to the change in the config system, notmuch keeps a notmuch database > > open when it would not do so before. Consequently, it can miss changes > > to the database which are done from a hook (while notmuch holds the > > databse in read only mode). When notmuch itself writes to the database > > after that it uses wrong assumptions about the last used doc id etc. > > > > Demonstrate this by triggering an assertion. (This new test succeeds > > with notmuch 0.31.4.) > > > > Signed-off-by: Michael J Gruber > > --- > > test/T400-hooks.sh | 21 +++++++++++++++++++++ > > 1 file changed, 21 insertions(+) > > > + notmuch search '*' > change.expected > > That line looks like leftover debugging to me, so I deleted > it. Otherwise it works fine, thanks for tracking down the bug and > providing a test. Thanks for the fix! I didn't put it in the commit message (because that commit might go before for your patch), but the test succeeds with your fix. Sorry for the debug line - typical case of re-editing without re-format-patching... I was wondering if it's worthwhile to test also: - that the change from pre hook is persistent (test for that msg) - test the same for post (even though the db is closed before) Cheers Michael