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 CIkcIGnBs14SWwAA0tVLHw (envelope-from ) for ; Thu, 07 May 2020 08:06:01 +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 gL/CJXXBs15zfAAA1q6Kng (envelope-from ) for ; Thu, 07 May 2020 08:06:13 +0000 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:470:142::17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7FE939402A0 for ; Thu, 7 May 2020 08:06:11 +0000 (UTC) Received: from localhost ([::1]:45518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWbXo-0001eu-5V for larch@yhetil.org; Thu, 07 May 2020 04:06:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWbXe-0001ZN-I9 for guix-patches@gnu.org; Thu, 07 May 2020 04:06:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58675) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jWbXe-0005TZ-8w for guix-patches@gnu.org; Thu, 07 May 2020 04:06:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jWbXe-0007to-3t for guix-patches@gnu.org; Thu, 07 May 2020 04:06:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41119] [PATCH] fix some issues with (guix nar) Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 07 May 2020 08:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41119 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Caleb Ristvedt Cc: 41119@debbugs.gnu.org Received: via spool by 41119-submit@debbugs.gnu.org id=B41119.158883872030240 (code B ref 41119); Thu, 07 May 2020 08:06:02 +0000 Received: (at 41119) by debbugs.gnu.org; 7 May 2020 08:05:20 +0000 Received: from localhost ([127.0.0.1]:41983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jWbWy-0007rg-9J for submit@debbugs.gnu.org; Thu, 07 May 2020 04:05:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jWbWv-0007r8-A4 for 41119@debbugs.gnu.org; Thu, 07 May 2020 04:05:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46241) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWbWq-0004ry-02; Thu, 07 May 2020 04:05:12 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=35696 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jWbWo-0000QT-SB; Thu, 07 May 2020 04:05:11 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87h7wsqu50.fsf@cune.org> Date: Thu, 07 May 2020 10:05:08 +0200 In-Reply-To: <87h7wsqu50.fsf@cune.org> (Caleb Ristvedt's message of "Wed, 06 May 2020 22:52:11 -0500") Message-ID: <87o8r0dvbf.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 X-Spam-Score: -1.01 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Scan-Result: default: False [-1.01 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.49762968602957]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2001:470:142::/48:c]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.11), country: US(-0.00), ip: 2001:470:142::17(-0.50)]; DWL_DNSWL_BLOCKED(0.00)[2001:470:142::17:from]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; RCPT_COUNT_TWO(0.00)[2]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_IN_DNSWL_FAIL(0.00)[2001:470:142::17:server fail]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:22989, ipnet:2001:470:142::/48, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[ludo@gnu.org,guix-patches-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; URIBL_BLOCKED(0.00)[cune.org:email]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[gnu.org]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_SEVEN(0.00)[9]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: oC7sX/JJPZ9e Hi! Caleb Ristvedt skribis: > From b2c66b443bd42e05820cfb3920c96f1894820587 Mon Sep 17 00:00:00 2001 > From: Caleb Ristvedt > Date: Wed, 6 May 2020 11:48:21 -0500 > Subject: [PATCH 1/2] nar: 'finalize-store-file' follows proper store lock > protocol. > > * guix/nar.scm (finalize-store-file): check for deletion token when acqui= ring > lock, write deletion token and delete lock file before releasing lock. [...] > + ;; TODO: make this reusable > + (define (acquire-lock filename) For consistency, s/filename/file/ please. :-) > + (let ((port (lock-file filename))) > + (if (zero? (stat:size (stat port))) > + port > + (begin Could you add a comment, like: =E2=80=9CIf FILE is non-empty, that=E2=80=99= s because it contains the deletion token, so try again.=E2=80=9D > (when lock? > + (delete-file (string-append target ".lock")) > + (display "d" lock) > + (force-output lock) Also a comment explaining why we=E2=80=99re writing a deletion token. It=E2=80=99s a fine point of the daemon that I had totally overlooked. I w= onder what the implications might have been. > From 43ee61b405b01038b3e7c84aba64521ab8a62236 Mon Sep 17 00:00:00 2001 > From: Caleb Ristvedt > Date: Wed, 6 May 2020 11:52:16 -0500 > Subject: [PATCH 2/2] nar: 'with-temporary-store-file' uses a single conne= ction > > Previously the 'with-store' form was entered every time a different tempo= rary > file was tried. This caused there to be as many simultaneous open connec= tions > as there were attempts, and prevented the (loop ...) call from being a ta= il > call. This change fixes that. > > * guix/nar.scm (with-temporary-store-file): open connection once prior to > entering the loop. LGTM! You can push both patches to =E2=80=98master=E2=80=99 (make sure =E2=80=9Cm= ake authenticate=E2=80=9D passes before you do). Thanks a lot for the quick fixes! Ludo=E2=80=99.