aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator/agent-messaging
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-05-11 11:37:14 +0100
committerChristopher Baines <mail@cbaines.net>2023-05-11 11:37:14 +0100
commit64202d823d5a07537d791baf7eb0feafa854d429 (patch)
tree6219c06f03e0308aecad83d00ff6f135845ade03 /guix-build-coordinator/agent-messaging
parent807d071871bb5c732dde61810cce3cee76becb95 (diff)
downloadbuild-coordinator-64202d823d5a07537d791baf7eb0feafa854d429.tar
build-coordinator-64202d823d5a07537d791baf7eb0feafa854d429.tar.gz
Add more exception handling in the hash computing thread
As I've seen log-msg here raise exceptions.
Diffstat (limited to 'guix-build-coordinator/agent-messaging')
-rw-r--r--guix-build-coordinator/agent-messaging/http/server.scm28
1 files changed, 18 insertions, 10 deletions
diff --git a/guix-build-coordinator/agent-messaging/http/server.scm b/guix-build-coordinator/agent-messaging/http/server.scm
index 9d7482c..b55d812 100644
--- a/guix-build-coordinator/agent-messaging/http/server.scm
+++ b/guix-build-coordinator/agent-messaging/http/server.scm
@@ -409,16 +409,24 @@ port. Also, the port used can be changed by passing the --port option.\n"
(call-with-new-thread
(lambda ()
- (set-thread-name "hash output")
- (log-msg logger 'DEBUG build-uuid ": computing hash of " filename)
-
- (put-message
- channel
- (list 'result
- filename
- (compute-hash-of-uploaded-output channel
- filename
- output-filename))))))))
+ (with-exception-handler
+ (lambda (exn)
+ (put-message channel
+ (list 'result
+ filename
+ exn)))
+ (lambda ()
+ (set-thread-name "hash output")
+ (log-msg logger 'DEBUG build-uuid ": computing hash of " filename)
+
+ (put-message
+ channel
+ (list 'result
+ filename
+ (compute-hash-of-uploaded-output channel
+ filename
+ output-filename))))
+ #:unwind? #t))))))
(('update filename bytes-processed)
(set-hash-progress-bytes-hashed!
(hash-ref hash-progress-by-filename filename)