From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 sAQYLn49CWJuNgAAgWs5BA (envelope-from ) for ; Sun, 13 Feb 2022 18:18:54 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 4DVlKn49CWKutQAAauVa8A (envelope-from ) for ; Sun, 13 Feb 2022 18:18:54 +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 86886148D8 for ; Sun, 13 Feb 2022 18:18:54 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 9F2FD5F6BC; Sun, 13 Feb 2022 17:18:53 +0000 (UTC) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mail.notmuchmail.org (Postfix) with ESMTPS id 2DEFB5F401 for ; Sun, 13 Feb 2022 17:18:50 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 5A51D5C01CA for ; Sun, 13 Feb 2022 12:18:49 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 13 Feb 2022 12:18:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; bh=N6F/b+iNU5ocEO0JlhCk87YXr/vXO08LDg5NkB pMbqg=; b=yZIcJ7yTiUKruquCj01TbGbLh4/sgZS/2l+ydhERXzh1BfVKDl6Idu jTDAGbrmQHQH98L3rEnMDRmyZeR8Xl2w+TQfWf91RSCAfa1F2LZOQOAO0SJ2aUV9 DHpdS+ceTq2eclYHq5eiQbrYXGO5g7/ic/wbeeWUvASQivWVtJLWq+lEppvqKtSE dQrZT6lHKmm5hBfGk0eHa+ppGSj90pCyt2tzZKdD3+vmqDJXQEJ5cEf+rI92Pczh 6sMEx5QFNK2ixHHvUfolnzamXk6+saj9bFBEXeomhAqZQfSG1iuKv0Vbuhsgxqzb BtrQlrOFRMGAxhR6awaA1YCUc3b2YVZA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=N6F/b+iNU5ocEO0Jl hCk87YXr/vXO08LDg5NkBpMbqg=; b=ob8ECmF3hCR3+OoEsQaJ2kE1fsyCdCgkr iEmaLh7RWnkCwwuLTIB97Nu3I9NvahLJyWLWUkdG4tjbBiQXibLnz62OcR4XtDWj egkxrhvPWQr+x5TWLrcRtUzyR5ZpsFHBzWuKn+qEHQH7mWbrRxO9jJlY50kBb7Ba QANp5q03VnjPMBPrJ1DemkKbp/kGWGPO9Hjbpvd3yjhFPKtFbmgci4ebbgV+/4lK Qlzor3KK5Oy+DL/+QTxpHqlGidOP/mDzpRwn2HB4VEGWwlIf6tf7XYoqKRa0jDvv tYjmhOHkl3xj5IMetS/y4Rg+yYmXl6wCzzu98KlE4vj0Qzidivosw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrjedtgdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufgjfhgffffkgggtsehttddttd dtredtnecuhfhrohhmpefuvggrnhcuhghhihhtthhonhcuoehsphifhhhithhtohhnsehs phifhhhithhtohhnrdhnrghmvgeqnecuggftrfgrthhtvghrnhepleeggefgvdeijedvhf dugfegtefgkeekueeileejjeehudeggeefteeghfeuffeknecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshhpfihhihhtthhonhesshhpfihhih htthhonhdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sun, 13 Feb 2022 12:18:49 -0500 (EST) Received: by athena.silentflame.com (Postfix, from userid 1000) id 28C8F1B5D38; Sun, 13 Feb 2022 17:18:48 +0000 (UTC) From: Sean Whitton To: notmuch@notmuchmail.org Subject: Re: [PATCH v2] nmbug: write tags out to a temporary file, not 'nmbug.index' In-Reply-To: <20220213165408.972859-1-spwhitton@spwhitton.name> References: <20220213165408.972859-1-spwhitton@spwhitton.name> User-Agent: Notmuch/0.31.4 (https://notmuchmail.org) Emacs/29.0.50 (x86_64-pc-linux-gnu) Date: Sun, 13 Feb 2022 10:18:48 -0700 Message-ID: <87a6eu3csn.fsf@athena.silentflame.com> MIME-Version: 1.0 Message-ID-Hash: QGLANMAQUUC4NJ3LGEXPOD6OV4Q3ULCO X-Message-ID-Hash: QGLANMAQUUC4NJ3LGEXPOD6OV4Q3ULCO X-MailFrom: spwhitton@spwhitton.name 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=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644772734; 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=/a29w5n9e79+LjcFS337o8oton/l5M1oN0B4i6YsjBA=; b=udOR9vvQDIgav0I7tqdSTzgni0ZJs8HMSnx0f5ZrAdL5wtGI+YR4I8qh0wMAzQF782TaBA o86Ui8Mn8GXrbEdAFfy4NdXnnk0YkRbD9LEC8R8P5ojvUgKTGAhSUHW/K+PmwGn0zOFM/A /gg8mz/AeDQLKopKpW+P92rwLJCVaMZzfSMpWfLbYQBxLI29+74UekQUFj1u3f5MJUL7EU 8m+gWm0ZPYMtDoriYvm7rqYUu2IoOfmPVDUuSgFWdC/EcKBgKzhgbfjT3Xf/AkcRgoXz62 dqojadAufKMfmz0BxLGk7x4cD93Oq6V9cgwANdzsB9Th4AvyAf2Ux2X6E8wqIw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644772734; a=rsa-sha256; cv=none; b=TWmW1zEJX+1MpZDjI6K2ftEkq1Kckw1bx97Hr4V4f4UxSUrvAdyrL8bqYZofpYe4Qg50yE N3TW7T8MIQzZ8zaNiz/RHq8RMuipPtc4uBTjz1s0FEqlrz6G5KoOFsGxf56BkK65cjvaR+ cTy6go1klFlkVzx+4t2IFJwcWfF4tyKGSUUOQIL5S6blSUeDJw3M2P2DltIs1RjC6yj1qd mbALaQY0brvHxRdqS5I9HnGTRjAi60JPU6N3vwAN9bw5ETS2xaNl4Xo9OeM0i44wuSbMJK J4gPpE8/Yt3TKl6HPKgHfbe7DklHnF+5+rBHgy14IQXKCQsu2PmrF1iJPNzDSQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=spwhitton.name header.s=fm2 header.b=yZIcJ7yT; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm2 header.b=ob8ECmF3; 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: -2.44 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=spwhitton.name header.s=fm2 header.b=yZIcJ7yT; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm2 header.b=ob8ECmF3; 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: 86886148D8 X-Spam-Score: -2.44 X-Migadu-Scanner: scn0.migadu.com X-TUID: geREs3NWc9lf 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. -- Sean Whitton