diff options
author | Christopher Baines <mail@cbaines.net> | 2020-05-23 08:51:06 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-05-23 08:51:06 +0100 |
commit | 06c30f561d2080ff7f18715e9956866004636716 (patch) | |
tree | 8fea361f1d4aa42f74651539d9750e3a179d67c9 | |
parent | 820bd07fd8af7ec077e9a9eca4266a0a73b842b9 (diff) | |
download | build-coordinator-06c30f561d2080ff7f18715e9956866004636716.tar build-coordinator-06c30f561d2080ff7f18715e9956866004636716.tar.gz |
Better handle failures to delete substitute cache files
The file can disappear if two threads try to delete it at once.
-rw-r--r-- | guix-build-coordinator/utils.scm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/guix-build-coordinator/utils.scm b/guix-build-coordinator/utils.scm index a95e970..28e245d 100644 --- a/guix-build-coordinator/utils.scm +++ b/guix-build-coordinator/utils.scm @@ -323,7 +323,15 @@ upcoming chunk." %narinfo-cache-directory "/" directory "/" hash-part))) (when (file-exists? cache-file) - (delete-file cache-file)))) + (with-exception-handler + (lambda (exn) + (simple-format + (current-error-port) + "error: when deleting substitute cache file: ~A\n" + exn)) + (lambda () + (delete-file cache-file)) + #:unwind? #t)))) (or directories '()))) (let ((narinfos |