aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix-build-coordinator/agent-messaging/http.scm45
1 files changed, 24 insertions, 21 deletions
diff --git a/guix-build-coordinator/agent-messaging/http.scm b/guix-build-coordinator/agent-messaging/http.scm
index 21b64d1..2c07336 100644
--- a/guix-build-coordinator/agent-messaging/http.scm
+++ b/guix-build-coordinator/agent-messaging/http.scm
@@ -339,27 +339,30 @@
(seek file-port bytes SEEK_SET)
(log 'INFO "resuming upload from byte " bytes))
- (let-values (((response body)
- (call-with-streaming-http-request
- (uri #:resume? (integer? bytes))
- (lambda (port)
- (with-time-logging
- (simple-format #f "sending ~A" file)
- (dump-port file-port port
- #:buffer-size 65536)))
- #:headers `((Authorization . ,auth-value))
- #:method (if bytes 'POST 'PUT)
- #:report-bytes-sent report-bytes-sent)))
- (when (>= (response-code response) 400)
- (raise-exception
- (make-exception-with-message
- (coordinator-handle-failed-request
- log
- 'PUT
- (uri-path
- (uri #:resume? (integer? bytes)))
- response
- body))))))))))
+ (with-timeout (* 20 60) ; 20 minutes
+ (raise-exception
+ (make-exception-with-message "timeout submitting output"))
+ (let-values (((response body)
+ (call-with-streaming-http-request
+ (uri #:resume? (integer? bytes))
+ (lambda (port)
+ (with-time-logging
+ (simple-format #f "sending ~A" file)
+ (dump-port file-port port
+ #:buffer-size 65536)))
+ #:headers `((Authorization . ,auth-value))
+ #:method (if bytes 'POST 'PUT)
+ #:report-bytes-sent report-bytes-sent)))
+ (when (>= (response-code response) 400)
+ (raise-exception
+ (make-exception-with-message
+ (coordinator-handle-failed-request
+ log
+ 'PUT
+ (uri-path
+ (uri #:resume? (integer? bytes)))
+ response
+ body)))))))))))
#:times 100
#:delay (random 15)))