From unknown Sat Jun 14 03:57:05 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#48826] [PATCH] scripts: substitute: Cache connection when looking for narinfos. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 04 Jun 2021 07:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48826 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48826@debbugs.gnu.org Cc: Mathieu Othacehe X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.162279016121666 (code B ref -1); Fri, 04 Jun 2021 07:03:01 +0000 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 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-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 unknown Sat Jun 14 03:57:05 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#48826] [PATCH] scripts: substitute: Cache connection when looking for narinfos. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 05 Jun 2021 20:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48826 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: 48826@debbugs.gnu.org Received: via spool by 48826-submit@debbugs.gnu.org id=B48826.162292451429224 (code B ref 48826); Sat, 05 Jun 2021 20:22:02 +0000 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= 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-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 unknown Sat Jun 14 03:57:05 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Mathieu Othacehe Subject: bug#48826: closed (Re: bug#48826: [PATCH] scripts: substitute: Cache connection when looking for narinfos.) Message-ID: References: <875yyrorsk.fsf_-_@gnu.org> <20210604070223.10680-1-othacehe@gnu.org> X-Gnu-PR-Message: they-closed 48826 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 48826@debbugs.gnu.org Date: Sun, 06 Jun 2021 16:57:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1622998622-31893-1" This is a multi-part message in MIME format... ------------=_1622998622-31893-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #48826: [PATCH] scripts: substitute: Cache connection when looking for nari= nfos. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 48826@debbugs.gnu.org. --=20 48826: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D48826 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1622998622-31893-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit 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 ------------=_1622998622-31893-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit 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 ------------=_1622998622-31893-1--