all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 72642@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>,
	"Christopher Baines" <guix@cbaines.net>,
	"Josselin Poiret" <dev@jpoiret.xyz>,
	"Ludovic Courtès" <ludo@gnu.org>,
	"Mathieu Othacehe" <othacehe@gnu.org>,
	"Simon Tournier" <zimon.toutoune@gmail.com>,
	"Tobias Geerinckx-Rice" <me@tobias.gr>
Subject: [bug#72642] [PATCH] substitute: Reopen connection upon “Error in the push function” from GnuTLS.
Date: Thu, 15 Aug 2024 18:18:19 +0200	[thread overview]
Message-ID: <ea0a78352a85cc604b1358bf437d1c1c4f34ec52.1723738529.git.ludo@gnu.org> (raw)

This works around an occasional issue where substitution stops abruptly
due to “Error in the push function” from GnuTLS, as reported at
<https://issues.guix.gnu.org/71238> by Richard Sent.

* guix/scripts/substitute.scm (call-with-cached-connection): Add
‘error/push-error’ and ‘error/pull-error’ to the list of gnutls-error
values for which the connection is reopened.

Change-Id: Icf079dd10b16739f62fee15bc3d90bab77110576
---
 guix/scripts/substitute.scm | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Hi!

This is an attempt to work around the dreaded “Error in the push function”
coming from GnuTLS and that would cause substitution to fail (“‘guix
substitute’ died unexpectedly”).  With this patch, a new connection attempt
is made.

This is not fully satisfactory since we don’t understand yet what causes
that error, which is not supposed to happen AIUI.  But at least, it should
provide more graceful handling.

Thoughts?

Thanks,
Ludo’.

diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 8bcbca5e7a..8db730a9c0 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -43,7 +43,11 @@ (define-module (guix scripts substitute)
                 #:select (uri-abbreviation nar-uri-abbreviation
                           (open-connection-for-uri
                            . guix:open-connection-for-uri)))
-  #:autoload   (gnutls) (error/invalid-session error/again error/interrupted)
+  #:autoload   (gnutls) (error/invalid-session
+                         error/again
+                         error/interrupted
+                         error/push-error
+                         error/pull-error)
   #:use-module (guix progress)
   #:use-module ((guix build syscalls)
                 #:select (set-thread-name))
@@ -426,6 +430,11 @@ (define (call-with-cached-connection uri proc)
                               (memq (first args)
                                     (list error/invalid-session
 
+                                          ;; "Error in the push function" is
+                                          ;; usually a transient error.
+                                          error/push-error
+                                          error/pull-error
+
                                           ;; XXX: These two are not properly handled in
                                           ;; GnuTLS < 3.7.3, in
                                           ;; 'write_to_session_record_port'; see

base-commit: 72e586fcae78e467d01e2add09c1db26be6bfa93
-- 
2.45.2





                 reply	other threads:[~2024-08-15 16:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=ea0a78352a85cc604b1358bf437d1c1c4f34ec52.1723738529.git.ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=72642@debbugs.gnu.org \
    --cc=dev@jpoiret.xyz \
    --cc=guix@cbaines.net \
    --cc=me@tobias.gr \
    --cc=othacehe@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.