unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: 49132@debbugs.gnu.org, "Ludovic Courtès" <ludo@gnu.org>
Subject: bug#49132: guix substitute: backtrace when the network is disabled during substitution
Date: Thu, 8 Jun 2023 23:17:53 +0200	[thread overview]
Message-ID: <423696ef-97b8-f67a-58e5-795a0df5a343@telenet.be> (raw)
In-Reply-To: <1fa57b9edcd62f9bea334688da9c4f009507b268.camel@telenet.be>


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

> Ah indeed, this is poorly handled.
> 
> I’m not really sure how to address it.  I/O ports are a nice abstraction
> as it allows you to transparently read “streams” from any medium, but as
> always, that also comes with opacity where the call site is not supposed
> to know what kind of exceptions might be thrown deep down.
>
> Thoughts?

About 'as always, [...]’: [citation needed].  AFAICT, nowhere does Guile 
documentation state they they aren't supposed to know.

Also, that seems a bad supposition to me if it prevents fixing the bug. 
I would just ignore that 'not supposed to’.

I think this supposition needs some adjustment in order to be practical:
guix/scripts/substitute.scm has opened the network connection (via 
http-client), so guix/scripts/substitute.scm is responsible for the 
connection (unless it delegates of course), so 
guix/scripts/substitute.scm is supposed to know what to do about 
exceptions involving that connection (unless it delegates).

That there are some intermediate modules before things are actually read 
from the port is irrelevant -- substitute.scm opened the port, is 
responsible for the port and knows best how to handle exceptional 
situations involving that port.

Nothing lower-level has the right context/information to make a good 
decision on how to handle the exception, so no delegation possible. As 
such, guix/scripts/substitute.scm should do it.

It's not 100% clear from the backtrace, but it appears that the 
exception (from guix/scripts/substitute.scm perspective) happens at:

;; Procedure: process-substitution
       ;; Unpack the Nar at INPUT into DESTINATION.
       (define cpu-usage
         (with-cpu-usage-monitoring
          (restore-file hashed destination
                        #:dump-file (if (and destination-in-store?
                                             deduplicate?)
                                        dump-file/deduplicate*
                                        dump-file))))

This should then be wrapped in an error handler catching 'bad-response', 
maybe reporting it, and switching over the next URL.

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

  parent reply	other threads:[~2023-06-08 21:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07 15:10 bug#48903: guix substitute: error: TLS error in procedure 'read_from_session_record_port': Error decoding the received TLS packet Maxim Cournoyer
2021-06-07 17:46 ` Maxime Devos
2021-06-11 15:09   ` Ludovic Courtès
2021-06-20 11:07     ` bug#49132: guix substitute: backtrace when the network is disabled during substitution Maxime Devos
2021-06-22 14:06       ` Ludovic Courtès
2023-06-08 21:17       ` Maxime Devos [this message]
2021-06-29 13:23     ` bug#48903: guix substitute: error: TLS error in procedure 'read_from_session_record_port': Error decoding the received TLS packet Maxim Cournoyer
2021-06-29 21:18       ` Ludovic Courtès
2021-06-30 16:26         ` Maxim Cournoyer
2021-07-01 13:12           ` Ludovic Courtès
2021-07-02 14:26             ` Maxim Cournoyer
2021-07-05 16:12               ` Ludovic Courtès
2021-07-08 13:59                 ` Maxim Cournoyer
2021-07-10 10:20                   ` Ludovic Courtès
2021-08-07  4:23                     ` Maxim Cournoyer

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=423696ef-97b8-f67a-58e5-795a0df5a343@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=49132@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).