[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10/14: substitute: Remove now redundant connection caching helpers.
From: |
guix-commits |
Subject: |
10/14: substitute: Remove now redundant connection caching helpers. |
Date: |
Mon, 22 Feb 2021 15:44:47 -0500 (EST) |
cbaines pushed a commit to branch master
in repository guix.
commit 7c85877fdf964694061e3192eac35723ebc047bf
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Thu Jan 7 20:36:58 2021 +0000
substitute: Remove now redundant connection caching helpers.
Failures now should be handled where they occur, and if there's a problem
that's symptomatic of an issue with the connection, the port should be
closed.
* guix/scripts/substitute.scm (call-with-cached-connection): Remove
procedure.
(with-cached-connection): Remove syntax rule.
---
guix/scripts/substitute.scm | 28 ----------------------------
1 file changed, 28 deletions(-)
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 5d4884a..a2b1526 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -690,32 +690,6 @@ server certificates."
(drain-input socket)
socket))))))))
-(define* (call-with-cached-connection uri proc
- #:optional
- (open-connection
- open-connection-for-uri/cached))
- (let ((port (open-connection uri)))
- (catch #t
- (lambda ()
- (proc port))
- (lambda (key . args)
- ;; 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, 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))))))
-
-(define-syntax-rule (with-cached-connection uri port exp ...)
- "Bind PORT with EXP... to a socket connected to URI."
- (call-with-cached-connection uri (lambda (port) exp ...)))
-
(define* (process-substitution store-item destination
#:key cache-urls acl
deduplicate? print-build-trace?)
@@ -1011,8 +985,6 @@ default value."
;;; Local Variables:
;;; eval: (put 'with-timeout 'scheme-indent-function 1)
-;;; eval: (put 'with-cached-connection 'scheme-indent-function 2)
-;;; eval: (put 'call-with-cached-connection 'scheme-indent-function 1)
;;; End:
;;; substitute.scm ends here
- branch master updated (f1f6e49 -> 20c08a8), guix-commits, 2021/02/22
- 01/14: substitute: Remove buffer handling from fetch., guix-commits, 2021/02/22
- 02/14: substitute: Remove connection handling from fetch., guix-commits, 2021/02/22
- 03/14: substitute: Remove redundant let block from fetch., guix-commits, 2021/02/22
- 04/14: guix: Move http-multiple-get to (guix http-client)., guix-commits, 2021/02/22
- 05/14: http-client: Add error handling to http-multiple-get., guix-commits, 2021/02/22
- 06/14: substitute: open-connection-for-uri/maybe add #:verify-certificate?., guix-commits, 2021/02/22
- 10/14: substitute: Remove now redundant connection caching helpers.,
guix-commits <=
- 08/14: http-client: Accept #:open-connection in http-fetch., guix-commits, 2021/02/22
- 07/14: substitute: Stop using call-with-cached-connection in fetch-narinfos., guix-commits, 2021/02/22
- 09/14: substitute: Change connection cache handling in process-substitution., guix-commits, 2021/02/22
- 13/14: substitute: Remove fetch-narinfos use open-connection-for-uri/maybe., guix-commits, 2021/02/22
- 11/14: substitute: Remove redundant fetch arguments., guix-commits, 2021/02/22
- 12/14: substitute: Inline fetch in to process-substitutes., guix-commits, 2021/02/22
- 14/14: substitute: Rework connection error handling., guix-commits, 2021/02/22