all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 58017@debbugs.gnu.org, 57978@debbugs.gnu.org,
	Attila Lendvai <attila@lendvai.name>,
	zimoun <zimon.toutoune@gmail.com>
Subject: bug#57978: [bug#58017] [PATCH 2/2] substitute: Retry downloading when a nar is unavailable.
Date: Sat, 24 Sep 2022 19:18:15 +0200	[thread overview]
Message-ID: <c0e05b63-3773-7350-76c8-15876fd873bc@telenet.be> (raw)
In-Reply-To: <87a66o7ndo.fsf@gnu.org>


[-- Attachment #1.1.1: Type: text/plain, Size: 1992 bytes --]



On 24-09-2022 18:22, Ludovic Courtès wrote:
> Hi Maxime,
> 
> Maxime Devos <maximedevos@telenet.be> skribis:
> 
>>> +(test-equal "substitute, first URL has narinfo but nar is 404, both URLs authorized"
>>> +  "Substitutable data."
>>> +  (with-narinfo*
>>> +      (string-append %narinfo "Signature: "
>>> +                     (signature-field %narinfo))
>>> +      %main-substitute-directory
>>> +
>>> +    (with-http-server `((200 ,(string-append %narinfo "Signature: "
>>> +                                             (signature-field %narinfo)))
>>> +                        (404 "Sorry, nar is missing!"))
>>> +      (dynamic-wind
>>> +        (const #t)
>>> +        (lambda ()
>>> +          (parameterize ((substitute-urls
>>> +                          (list (%local-url)
>>> +                                (string-append "file://"
>>> +                                               %main-substitute-directory))))
>>> +            (request-substitution (string-append (%store-prefix)
>>> +                                                 "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo")
>>> +                                  "substitute-retrieved"))
>>> +          (call-with-input-file "substitute-retrieved" get-string-all))
>>> +        (lambda ()
>>> +          (false-if-exception (delete-file "substitute-retrieved")))))))
>>
>> Shouldn't it only ignore 'file not found' (ENOENT?) exceptions?
> 
> By “it”, do you mean ‘dynamic-wind’ should be replaced by a ‘catch’
> form?

No, I'm not referring to the dynamic-wind as a whole, rather 'it' = the 
following code:

  (false-if-exception (delete-file "substitute-retrieved"))

-- the catch can stay, AFAIK.

> We could discuss it, but note that this patch just keeps with the style
> of existing tests.

For the reasons given, I don't think this style should be continued, 
though I suppose all of them can be done at once in a separate patch.

Greetings,
Maxime.

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

  reply	other threads:[~2022-09-24 17:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-21 13:11 bug#57978: the fallback machanism for substitute servers doesn't work? Attila Lendvai
2022-09-21 20:43 ` zimoun
2022-09-22  9:47 ` Ludovic Courtès
2022-09-23  6:16   ` bug#57978: [PATCH 0/2] Retry nar downloads upon failure Ludovic Courtès
2022-09-28 21:24     ` bug#57978: bug#58017: " Ludovic Courtès
2022-09-23  6:19 ` bug#57978: [PATCH 1/2] substitute: Split nar download Ludovic Courtès
2022-09-23  6:19   ` bug#57978: [PATCH 2/2] substitute: Retry downloading when a nar is unavailable Ludovic Courtès
2022-09-23  8:17     ` [bug#58017] " zimoun
2022-09-24 16:20       ` Ludovic Courtès
2022-09-24  1:57     ` bug#57978: [bug#58017] " Maxime Devos
2022-09-24 16:22       ` Ludovic Courtès
2022-09-24 17:18         ` Maxime Devos [this message]
2022-09-23  7:56   ` bug#57978: [PATCH 1/2] substitute: Split nar download zimoun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c0e05b63-3773-7350-76c8-15876fd873bc@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=57978@debbugs.gnu.org \
    --cc=58017@debbugs.gnu.org \
    --cc=attila@lendvai.name \
    --cc=ludo@gnu.org \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.