diff options
author | Christopher Baines <mail@cbaines.net> | 2020-05-23 23:08:48 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-05-23 23:08:48 +0100 |
commit | d6739ebc2d7db652d1837697d077723ea2994ffd (patch) | |
tree | d0a2c6043618f68b4d9b532d8364a5a4baa93f3c | |
parent | 21b7f18f84b2f3817b468e3f137069745916d80c (diff) | |
download | build-coordinator-d6739ebc2d7db652d1837697d077723ea2994ffd.tar build-coordinator-d6739ebc2d7db652d1837697d077723ea2994ffd.tar.gz |
Handle log files not being immediately available
I think the daemon might take some time to produce them, so retry finding the
log file.
-rw-r--r-- | guix-build-coordinator/agent.scm | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/guix-build-coordinator/agent.scm b/guix-build-coordinator/agent.scm index 4e6d3df..221a6f2 100644 --- a/guix-build-coordinator/agent.scm +++ b/guix-build-coordinator/agent.scm @@ -62,14 +62,26 @@ (simple-format #t "setup successful, building: ~A\n" derivation-name) (let ((result (perform-build derivation-name))) - (and=> (derivation-log-file derivation-name) - (lambda (log-file) - (simple-format #t "uploading log file ~A\n" - log-file) - (submit-log-file - coordinator-uri uuid password - (assoc-ref build "uuid") - log-file))) + (retry-on-error + (lambda () + (let ((log-file (derivation-log-file derivation-name))) + (unless log-file + (raise-exception + (make-exception-with-message + (simple-format + #f + "log file missing for ~A (~A)" + derivation-name + (assoc-ref build "uuid"))))) + + (simple-format #t "uploading log file ~A\n" + log-file) + (submit-log-file + coordinator-uri uuid password + (assoc-ref build "uuid") + log-file))) + #:times 6 + #:delay 10) ((if result post-build-success post-build-failure) |