diff options
Diffstat (limited to 'guix-build-coordinator/agent.scm')
-rw-r--r-- | guix-build-coordinator/agent.scm | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/guix-build-coordinator/agent.scm b/guix-build-coordinator/agent.scm index f5ae50a..fc0ed3f 100644 --- a/guix-build-coordinator/agent.scm +++ b/guix-build-coordinator/agent.scm @@ -960,6 +960,22 @@ but the guix-daemon claims it's unavailable" (define outputs (derivation-outputs derivation)) + (define (maybe-delete-compressed-outputs) + (with-exception-handler + (lambda (exn) + (log-msg lgr 'ERROR + build-id ": exception deleting compressed outputs: " + exn)) + (lambda () + (when submit-outputs? + (for-each + (lambda (file) + (log-msg lgr 'INFO + build-id ": deleting " file) + (delete-file file)) + (map cdr compressed-outputs)))) + #:unwind? #t)) + (define (attempt-submit-build-result) (with-exception-handler (lambda (exn) @@ -973,10 +989,12 @@ but the guix-daemon claims it's unavailable" ((string=? details "build_already_processed") (log-msg lgr 'WARN build-id ": coordinator indicates this build is already marked as processed") + (maybe-delete-compressed-outputs) #t) ((string=? details "cannot_store_result_for_canceled_build") (log-msg lgr 'WARN build-id ": coordinator indicates this build is now canceled") + (maybe-delete-compressed-outputs) #t) ((string=? details "missing_build_log_file") ;; Retry submitting the log file @@ -987,6 +1005,8 @@ but the guix-daemon claims it's unavailable" (attempt-submit-build-result)) (else + (maybe-delete-compressed-outputs) + (raise-exception (make-exception (make-exception-with-message @@ -1044,13 +1064,7 @@ but the guix-daemon claims it's unavailable" (outputs . ,(list->vector output-details))) #:log (build-log-procedure lgr build-id)) - (when submit-outputs? - (for-each - (lambda (file) - (log-msg lgr 'INFO - build-id ": deleting " file) - (delete-file file)) - (map cdr compressed-outputs)))) + (maybe-delete-compressed-outputs)) #:unwind? #t)) (define (submit-one-output output-name output bytes compressed-file) |