From unknown Sat Jun 14 03:48:01 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#48826 <48826@debbugs.gnu.org> To: bug#48826 <48826@debbugs.gnu.org> Subject: Status: [PATCH] scripts: substitute: Cache connection when looking for narinfos. Reply-To: bug#48826 <48826@debbugs.gnu.org> Date: Sat, 14 Jun 2025 10:48:01 +0000 retitle 48826 [PATCH] scripts: substitute: Cache connection when looking fo= r narinfos. reassign 48826 guix-patches submitter 48826 Mathieu Othacehe severity 48826 normal tag 48826 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 04 03:02:41 2021 Received: (at submit) by debbugs.gnu.org; 4 Jun 2021 07:02:41 +0000 Received: from localhost ([127.0.0.1]:45214 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lp3qr-0005dO-9t for submit@debbugs.gnu.org; Fri, 04 Jun 2021 03:02:41 -0400 Received: from lists.gnu.org ([209.51.188.17]:60138) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lp3qn-0005dD-5e for submit@debbugs.gnu.org; Fri, 04 Jun 2021 03:02:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lp3ql-0004lG-HQ for guix-patches@gnu.org; Fri, 04 Jun 2021 03:02:36 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58462) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lp3ql-0004iC-0D for guix-patches@gnu.org; Fri, 04 Jun 2021 03:02:35 -0400 Received: from [2a01:e0a:19b:d9a0:f2f7:a404:c3d3:f8b4] (port=33836 helo=localhost.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lp3qk-00051d-Ap; Fri, 04 Jun 2021 03:02:34 -0400 From: Mathieu Othacehe To: guix-patches@gnu.org Subject: [PATCH] scripts: substitute: Cache connection when looking for narinfos. Date: Fri, 4 Jun 2021 09:02:23 +0200 Message-Id: <20210604070223.10680-1-othacehe@gnu.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: Mathieu Othacehe X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) The process-substitution procedure is opening two distinct connections. The first one when looking for narinfo by calling lookup-narinfo and the other one when fetching nar files. Cache the connection when looking for narinfos so that process-substitution only opens one connection. * guix/scripts/substitute.scm (lookup-narinfo): Cache connection by using open-connection-for-uri/cached. --- guix/scripts/substitute.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 54311c3e08..44448ff3e9 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -163,7 +163,9 @@ if file doesn't exist, and the narinfo otherwise." (define (lookup-narinfo caches path authorized?) "Return the narinfo for PATH in CACHES, or #f when no substitute for PATH was found." - (match (lookup-narinfos/diverse caches (list path) authorized?) + (match (lookup-narinfos/diverse + caches (list path) authorized? + #:open-connection open-connection-for-uri/cached) ((answer) answer) (_ #f))) -- 2.31.1 From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 05 16:21:54 2021 Received: (at 48826) by debbugs.gnu.org; 5 Jun 2021 20:21:54 +0000 Received: from localhost ([127.0.0.1]:50121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lpcnq-0007bI-Iq for submit@debbugs.gnu.org; Sat, 05 Jun 2021 16:21:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lpcno-0007b5-5C for 48826@debbugs.gnu.org; Sat, 05 Jun 2021 16:21:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57670) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpcnj-0008AO-0o for 48826@debbugs.gnu.org; Sat, 05 Jun 2021 16:21:47 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36338 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpcni-0002DD-Jg; Sat, 05 Jun 2021 16:21:46 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Mathieu Othacehe Subject: Re: bug#48826: [PATCH] scripts: substitute: Cache connection when looking for narinfos. References: <20210604070223.10680-1-othacehe@gnu.org> Date: Sat, 05 Jun 2021 22:21:45 +0200 In-Reply-To: <20210604070223.10680-1-othacehe@gnu.org> (Mathieu Othacehe's message of "Fri, 4 Jun 2021 09:02:23 +0200") Message-ID: <874kecnjty.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48826 Cc: 48826@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Mathieu, Mathieu Othacehe skribis: > The process-substitution procedure is opening two distinct connections. T= he > first one when looking for narinfo by calling lookup-narinfo and the othe= r one > when fetching nar files. > > Cache the connection when looking for narinfos so that process-substituti= on > only opens one connection. > > * guix/scripts/substitute.scm (lookup-narinfo): Cache connection by using > open-connection-for-uri/cached. Good catch, LGTM! Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 06 12:56:52 2021 Received: (at 48826-done) by debbugs.gnu.org; 6 Jun 2021 16:56:52 +0000 Received: from localhost ([127.0.0.1]:53794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lpw4y-0008I3-6d for submit@debbugs.gnu.org; Sun, 06 Jun 2021 12:56:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lpw4x-0008Hp-NU for 48826-done@debbugs.gnu.org; Sun, 06 Jun 2021 12:56:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54338) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpw4s-0005P2-5X; Sun, 06 Jun 2021 12:56:46 -0400 Received: from [2a01:cb1c:5dc:f000:66c4:b3dd:2ba2:5688] (port=58464 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpw4r-000626-OU; Sun, 06 Jun 2021 12:56:46 -0400 From: Mathieu Othacehe To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#48826: [PATCH] scripts: substitute: Cache connection when looking for narinfos. References: <20210604070223.10680-1-othacehe@gnu.org> <874kecnjty.fsf@gnu.org> Date: Sun, 06 Jun 2021 18:56:43 +0200 In-Reply-To: <874kecnjty.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Sat, 05 Jun 2021 22:21:45 +0200") Message-ID: <875yyrorsk.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48826-done Cc: 48826-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hey, > Good catch, LGTM! Pushed as a068ed6a5f5b3535fce49ac4eca1fec82edd6fdc. Thanks, Mathieu From unknown Sat Jun 14 03:48:01 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 05 Jul 2021 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator