GNU bug report logs - #48826
[PATCH] scripts: substitute: Cache connection when looking for narinfos.

Previous Next

Package: guix-patches;

Reported by: Mathieu Othacehe <othacehe <at> gnu.org>

Date: Fri, 4 Jun 2021 07:03:01 UTC

Severity: normal

Tags: patch

Done: Mathieu Othacehe <othacehe <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 48826 in the body.
You can then email your comments to 48826 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#48826; Package guix-patches. (Fri, 04 Jun 2021 07:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mathieu Othacehe <othacehe <at> gnu.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 04 Jun 2021 07:03:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Mathieu Othacehe <othacehe <at> gnu.org>
Subject: [PATCH] scripts: substitute: Cache connection when looking for
 narinfos.
Date: Fri,  4 Jun 2021 09:02:23 +0200
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





Information forwarded to guix-patches <at> gnu.org:
bug#48826; Package guix-patches. (Sat, 05 Jun 2021 20:22:02 GMT) Full text and rfc822 format available.

Message #8 received at 48826 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 48826 <at> debbugs.gnu.org
Subject: Re: bug#48826: [PATCH] scripts: substitute: Cache connection when
 looking for narinfos.
Date: Sat, 05 Jun 2021 22:21:45 +0200
Hi Mathieu,

Mathieu Othacehe <othacehe <at> gnu.org> skribis:

> 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.

Good catch, LGTM!

Thanks,
Ludo’.




Reply sent to Mathieu Othacehe <othacehe <at> gnu.org>:
You have taken responsibility. (Sun, 06 Jun 2021 16:57:01 GMT) Full text and rfc822 format available.

Notification sent to Mathieu Othacehe <othacehe <at> gnu.org>:
bug acknowledged by developer. (Sun, 06 Jun 2021 16:57:01 GMT) Full text and rfc822 format available.

Message #13 received at 48826-done <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 48826-done <at> debbugs.gnu.org
Subject: Re: bug#48826: [PATCH] scripts: substitute: Cache connection when
 looking for narinfos.
Date: Sun, 06 Jun 2021 18:56:43 +0200
Hey,

> Good catch, LGTM!

Pushed as a068ed6a5f5b3535fce49ac4eca1fec82edd6fdc.

Thanks,

Mathieu




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 05 Jul 2021 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 290 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.