aboutsummaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-01-04 11:05:58 +0100
committerLudovic Courtès <ludo@gnu.org>2021-01-04 11:51:48 +0100
commit9158020d7853b6e7925802e0d0a082801c680e8f (patch)
treec5e29d2de4db7ce5cba4be021cb83fb0d5b7a2d4 /guix
parented63b7f87e88b0ce9c4a78bf0529599de9172b1f (diff)
downloadguix-9158020d7853b6e7925802e0d0a082801c680e8f.tar
guix-9158020d7853b6e7925802e0d0a082801c680e8f.tar.gz
substitute: Handle "invalid session" GnuTLS errors on reused connections.
Reported by Christopher Baines <mail@cbaines.net> at <https://issues.guix.gnu.org/45323#2>. * guix/scripts/substitute.scm (call-with-cached-connection): Handle 'gnutls-error and ERROR/INVALID-SESSION.
Diffstat (limited to 'guix')
-rwxr-xr-xguix/scripts/substitute.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 8084c89ae5..e53de8c304 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -43,6 +43,7 @@
(open-connection-for-uri
. guix:open-connection-for-uri)
store-path-abbreviation byte-count->string))
+ #:autoload (gnutls) (error/invalid-session)
#:use-module (guix progress)
#:use-module ((guix build syscalls)
#:select (set-thread-name))
@@ -1054,9 +1055,12 @@ server certificates."
;; If PORT was cached and the server closed the connection in the
;; meantime, we get EPIPE. In that case, open a fresh connection and
;; retry. We might also get 'bad-response or a similar exception from
- ;; (web response) later on, once we've sent the request.
+ ;; (web response) later on, once we've sent the request, or a
+ ;; ERROR/INVALID-SESSION from GnuTLS.
(if (or (and (eq? key 'system-error)
(= EPIPE (system-error-errno `(,key ,@args))))
+ (and (eq? key 'gnutls-error)
+ (eq? (first args) error/invalid-session))
(memq key '(bad-response bad-header bad-header-component)))
(proc (open-connection uri #:fresh? #t))
(apply throw key args))))))