From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sLsJIUBJCWLEkAAAgWs5BA (envelope-from ) for ; Sun, 13 Feb 2022 19:09:04 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 2I1nHkBJCWLntwAA9RJhRA (envelope-from ) for ; Sun, 13 Feb 2022 19:09:04 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (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 D029215629 for ; Sun, 13 Feb 2022 19:09:03 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id C512B5F6B5; Sun, 13 Feb 2022 18:09:01 +0000 (UTC) Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [IPv6:2a0b:5c81:1c1::37]) by mail.notmuchmail.org (Postfix) with ESMTPS id 1B6EA5F401 for ; Sun, 13 Feb 2022 18:08:59 +0000 (UTC) Received: from guru.guru-group.fi (unknown [IPv6:2a02:2380:1:9:5054:ff:feb7:a4bc]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 9F57A1B000E5; Sun, 13 Feb 2022 20:08:57 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1644775737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DQHw0V38HgKSodH8zF3kxHoRUMI0fodS7llqiDV08cs=; b=ckAk+p60fquYxtsdAQItXo19K6YttvEQYjvwTltR3x5z+HXv4XXMb1oPv4S5VddvASZ0RE z7yV24JQ17fbkxRhgoyn/X/u7RmUnj/eqvvXbNa9N2tQu78fgMYNIhAV18gKN++r69KUO2 9kgsAuBHrsEolKf7KDcVXHKPNEOvaREHpsUzGlCZ36wOsgNLVlcLxYIlCjmN2P3ONjv7xD jQoZe0UvtKYWxNs8NIPtsqs2z6zz5WyxvNAabQNNRARYUPQ174b7XE36NloxT6rjzsSDJd 8KGRURvSUbPq2B6Zf+MyHCm2S/gvdlfwV7Yhh9hGv7sMDiRESunn10tFNarIOQ== From: Tomi Ollila To: Sean Whitton , notmuch@notmuchmail.org Subject: Re: [PATCH v2] nmbug: write tags out to a temporary file, not 'nmbug.index' In-Reply-To: <87a6eu3csn.fsf@athena.silentflame.com> References: <20220213165408.972859-1-spwhitton@spwhitton.name> <87a6eu3csn.fsf@athena.silentflame.com> User-Agent: Notmuch/0.35+4~ge2bb4cd (https://notmuchmail.org) Emacs/27.1 X-Face: HhBM'cA~ MIME-Version: 1.0 ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1644775737; a=rsa-sha256; cv=none; b=gLi6HJ3EdNZVoNslLeuTelPWm/ZHVAVw1R0gAbeCg24wJh58zWkAcwGhkhi2jvJT4povqd 1H/eKfkybKUBRK6IoecX5Anu5rwLVPLkD84WSpBiuiSjoqhml9e/eooPvBKbxgThefEeQY QAa4jsHAfbLJr2QbNgggW7aNu2nB+itdWN50doclC6vfzr1Ky4ixkHFaABPqrVFNuMbYyn oeERjmlF0QoSEWwoyhiwoDtM9fqdRhSh+Zo9mqNc6pHAhUbsQrj8oAOEpKXwxmeXFEznGa UrOeLl2CUZg40CypQxscWMERubYEZvAyZ/tWiHiWHWBa9hXr5T/i5WbOVtedjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1644775737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DQHw0V38HgKSodH8zF3kxHoRUMI0fodS7llqiDV08cs=; b=mGWeo0s+MBkrXIPim2+Sig6Q9SG4ZX7+j0w2LtkmQM00BAaI2ccldQVv8hYF+2o5TVNVmo tB1Czd8rWhD2uU42CKYj1ldr9F3Zd7owoJTn5u/LhCfEYdS7J6r6Wda6liy/PvvGsP64+7 yvU5g42RbcWSGv4cgo9RWKWlt1M5Oyee0y6k8cdnZzFyA3a72+nCCnKMpaPagyxPjQPDB5 w1UaSgtGwcA3axUG0nRK2xYGn8btJ/2+gAA/jpX9eF4cuHcXAxvdPf3rC95Ai9dCb6KrUz CEL62zX05gP9GZuWXotdIKiTakx5xjmGRDSkBebz11sxZ8TR4pUt5Mb/QjBbGA== Message-ID-Hash: BAAAI2CLDYAKOVWVFRIQ2DTFZOIBFIIE X-Message-ID-Hash: BAAAI2CLDYAKOVWVFRIQ2DTFZOIBFIIE X-MailFrom: tomi.ollila@iki.fi 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; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644775744; 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-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=5skyj4i+8wySEQlkRJ8V0ew+rYNsoppF1YSo+XcnpaI=; b=K84u0qkQR0CKae1IcwfyUqld0dM8ZICNFp52xeNQ24DOF3ojPqWvKfdi5Tm0XZnH85JTMZ o+jHhMurUHvLD8FD6wn5v/ilLsd2U/TB4KBCfdhjh/lJR0A7le4EpfaJeOTzfeMsj7dm34 m4XAKktIl43hT9XCWqXwDIsgOLC11CmToz+ArSkWotgklbuKxpcFdCaf85S+D1hQN7j+W3 nYDywpmawwjkkwm2sAuJXRa3f8WCfb5KdvlLhJNULWAQc+wEApIuVFYxK1utVXSeUXHi0M BiS6WE52TtHCrWvrGRY9qotG0i6bllik4G8z56P8VzK8OePM8i0QxOkoo23nIg== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1644775744; a=rsa-sha256; cv=fail; b=leH3JG4gla2D23BvuPLhACXMYlryWJjwlF2JNjQyfL5wB1hzL8O/6R/NEfSYV13mFs1Epj 5HVrAqycCRdJHnAHPQRqe94QyWvAUlIsKZslB9AcnZPICSpls8Lwc5d5GV6+N8GUnV4kbr uHVFEkbLZP8pdGv9MecvukNxw/88WEUzEjwJemyVWQZczG6sdC5FxmEunP/XJwdJY0x/oB kc3lrg0CBtUM8bPDPqesN05MNWYprFPd9PSeCEdlW7vnpGtTMycQOYo49xbd6xtbwqpSec gg96W3umgIkngnzBoyouwumekDV6NOUQj8eOjfc6xFFiZlb7zTN9oB6cPOoaVA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=ckAk+p60; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -0.34 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=ckAk+p60; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: D029215629 X-Spam-Score: -0.34 X-Migadu-Scanner: scn1.migadu.com X-TUID: 9wnZpElsAiO/ On Sun, Feb 13 2022, Sean Whitton wrote: > Hello, > > On Sun 13 Feb 2022 at 09:54am -07, Sean Whitton wrote: > >> If more than nmbug process is running at once, then each will try to >> read and write the same file. The particular failure I've seen is >> that the process which finishes first deletes nmbug.index, and then >> the other process dies with a FileNotFoundError. So use a distinct >> temporary file per process. >> --- >> devel/nmbug/nmbug | 44 ++++++++++++++++++++++---------------------- >> 1 file changed, 22 insertions(+), 22 deletions(-) >> >> Here is a second attempt, though I'm afraid I have little idea whether it is >> idiomatic Python. > > It would seem this causes 'nmbug status' to output just one result. > > I'll leave the fix to someone with more Python experience. Sorry for > the improperly tested v2 patch. One option would be using the first patch, but instead of mkstemp(), NamedTemporaryFile(dir=NMBGIT, prefix="nmbug.index") to be used instead (and then path.name and index.name in place of path and index...) Tomi > > -- > Sean Whitton