[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#45409] [PATCH v4 10/13] substitute: Remove now redundant connection
From: |
Christopher Baines |
Subject: |
[bug#45409] [PATCH v4 10/13] substitute: Remove now redundant connection caching helpers. |
Date: |
Sat, 16 Jan 2021 13:58:00 +0000 |
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 fc5a19124e..d316bdef15 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -689,32 +689,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?)
@@ -1010,8 +984,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
--
2.30.0
- [bug#45409] [PATCH v4 01/13] substitute: Remove buffer handling from fetch., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 02/13] substitute: Remove connection handling from fetch., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 04/13] guix: Move http-multiple-get to (guix http-client)., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 11/13] substitute: Remove redundant fetch arguments., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 05/13] http-client: Add error handling to http-multiple-get., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 06/13] substitute: open-connection-for-uri/maybe add #:verify-certificate?., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 07/13] substitute: Stop using call-with-cached-connection in fetch-narinfos., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 03/13] substitute: Remove redundant let block from fetch., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 10/13] substitute: Remove now redundant connection caching helpers.,
Christopher Baines <=
- [bug#45409] [PATCH v4 12/13] substitute: Inline fetch in to process-substitutes., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 08/13] http-client: Accept #:open-connection in http-fetch., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 13/13] substitute: Remove fetch-narinfos use open-connection-for-uri/maybe., Christopher Baines, 2021/01/16
- [bug#45409] [PATCH v4 09/13] substitute: Change connection cache handling in process-substitution., Christopher Baines, 2021/01/16