unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Attila Lendvai <attila@lendvai.name>
To: Maxime Devos <maximedevos@telenet.be>
Cc: 55242@debbugs.gnu.org
Subject: [bug#55242] [PATCH 07/10] guix: import: go: More resilience wrt network errors; add logging.
Date: Tue, 03 May 2022 17:00:30 +0000	[thread overview]
Message-ID: <O9w-304SD4fvo6wWmpf2MalIwuxcoKjwxTx1eKYl9jkla_-7NUaoSc8ld3R01g-9GRQHCHeMuNvHQsPMpF0rSR8HnG3KTrf_oPiCKY2OR5Y=@lendvai.name> (raw)
In-Reply-To: <7974a00256e3ee153507f77d6b0a405473e9bbc4.camel@telenet.be>

> > +                   (let ((port (current-warning-port)))
> > +                     (format port "Unexpected error, will skip ~S.~%reason: "
> > +                             package-name)
> > +                     ;; Printing a backtrace here is not very useful: it is
> > +                     ;; cut off because GUARD unwinds.
> > +                     (print-exception port (stack-ref (make-stack #t) 1)
> > +                                      c (exception-args c))
> > +                     (display-backtrace (make-stack #t) port))
>
>
> Why are unknown errors being catched here?

*all* errors are caught, displayed, and swallowed, so that the importing can proceed to the rest of the packages.

a possible scenario: a large import can take several minutes. if there's a transient network error, then this way it may finish with 99% of the packages, and the rest can be restarted by hand after inspecting the log output.

another scenario is that the importer is simply buggy, and the user gets 99% of the packages imported, and has to do only one package by hand.


> What's the '-continuable' for here?  Is it to avoid extra 'raise-
> exception' entries in the backtrace, or does this actually make use
> of Scheme's continuable exceptions?


honestly, i can't remember. which translates to: i should have
commented on that!

*shakes head and makes a mental note*

from guile's manual:

"If continuable? is true, the handler is invoked in tail position
relative to the raise-exception call. Otherwise if the handler
returns, a non-continuable exception of type &non-continuable is
raised in the same dynamic environment as the handler."

i.e. it should rather be called raise-continuably not
raise-continuable.

and i think the reason is that the stack is not unwound that way, so
that the handlers in the guard can print a backtrace showing the
entire stack.

does this make sense? i'm still learning scheme's stack/exception
handling...

or maybe what i wanted is that the handlers in the guard can return
with (values #f '())? but i think that should work with vanilla RAISE,
too.


> Why a warning instead of a 'report-error'?


because i want the importer to be able to deal with a transitive
closures of dependencies with > 400 entries. if it fails at the first
error, then a `guix import go -r` becomes a hopeless endeavor for
larger go modules.

thanks for the review Maxime! i'll address the rest, too.

--
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“'Emergencies' have always been the pretext on which the safeguards of individual liberty have been eroded.”
	— F. A. Hayek (1899–1992)





  reply	other threads:[~2022-05-03 17:01 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-03 11:16 [bug#55242] [PATCH 01/10] guix: import: Print the number of packages at the end Attila Lendvai
2022-05-03 11:42 ` [bug#55242] [PATCH 02/10] guix: import: go: Rename go.pkg.dev-info to pkg.go.dev-info Attila Lendvai
2022-05-03 11:42   ` [bug#55242] [PATCH 03/10] guix: import: go: Add mockup logging facility Attila Lendvai
2022-05-03 16:23     ` Maxime Devos
2022-06-14 19:46     ` [bug#55242] [PATCH 01/10] guix: import: Print the number of packages at the end Maxim Cournoyer
2022-05-03 11:42   ` [bug#55242] [PATCH 04/10] guix: import: go: Fix the interpretation of the replace directive Attila Lendvai
2022-05-03 16:25     ` Maxime Devos
2022-05-03 16:26     ` Maxime Devos
2022-05-03 16:27     ` Maxime Devos
2022-05-03 16:28     ` Maxime Devos
2022-05-03 11:42   ` [bug#55242] [PATCH 05/10] guix: import: go: Harden sxml->texi conversion Attila Lendvai
2022-05-03 16:32     ` Maxime Devos
2022-05-03 11:42   ` [bug#55242] [PATCH 06/10] guix: import: go: Add a local duplicate of http-fetch Attila Lendvai
2022-05-03 11:42   ` [bug#55242] [PATCH 07/10] guix: import: go: More resilience wrt network errors; add logging Attila Lendvai
2022-05-03 16:12     ` Maxime Devos
2022-05-03 17:00       ` Attila Lendvai [this message]
2022-05-03 17:38         ` Maxime Devos
2022-05-09 12:34           ` Attila Lendvai
2022-05-09 17:45             ` Maxime Devos
2022-05-09 20:02               ` Attila Lendvai
2022-05-09 20:08                 ` Maxime Devos
2022-05-03 16:17     ` Maxime Devos
2022-05-03 16:36     ` Maxime Devos
2022-05-03 16:37     ` Maxime Devos
2022-05-03 11:42   ` [bug#55242] [PATCH 08/10] guix: import: go: Modules in a subdir and prefixed tags Attila Lendvai
2022-05-03 16:42     ` Maxime Devos
2022-05-03 16:48     ` Maxime Devos
2022-05-03 16:50     ` Maxime Devos
2022-05-09 12:50       ` Attila Lendvai
2022-05-03 16:51     ` Maxime Devos
2022-05-03 16:53     ` Maxime Devos
2022-05-03 16:55     ` Maxime Devos
2022-05-03 16:56     ` Maxime Devos
2022-05-03 16:59     ` Maxime Devos
2022-05-03 17:00     ` Maxime Devos
2022-05-03 17:01     ` Maxime Devos
2022-05-03 11:43   ` [bug#55242] [PATCH 09/10] guix: import: go: module-name -> module-path to be consistent Attila Lendvai
2022-05-03 11:43   ` [bug#55242] [PATCH 10/10] guix: import: go: Better handling of /v2 in the module path Attila Lendvai
2022-05-09 20:39     ` Maxime Devos
2022-05-03 16:22   ` [bug#55242] [PATCH 02/10] guix: import: go: Rename go.pkg.dev-info to pkg.go.dev-info Maxime Devos
2022-05-03 16:21 ` [bug#55242] [PATCH 01/10] guix: import: Print the number of packages at the end Maxime Devos
2022-05-03 17:29 ` Maxime Devos
2022-05-09 12:37   ` Attila Lendvai
2022-05-14  7:09 ` Maxime Devos
2022-05-14  7:15 ` Maxime Devos

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='O9w-304SD4fvo6wWmpf2MalIwuxcoKjwxTx1eKYl9jkla_-7NUaoSc8ld3R01g-9GRQHCHeMuNvHQsPMpF0rSR8HnG3KTrf_oPiCKY2OR5Y=@lendvai.name' \
    --to=attila@lendvai.name \
    --cc=55242@debbugs.gnu.org \
    --cc=maximedevos@telenet.be \
    /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).