[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: branch master updated: remote-server: Fix fetch worker crash.
From: |
Ludovic Courtès |
Subject: |
Re: branch master updated: remote-server: Fix fetch worker crash. |
Date: |
Sun, 05 Dec 2021 22:19:55 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Hi,
m.othacehe@gmail.com (Mathieu Othacehe) skribis:
> --- a/src/cuirass/scripts/remote-server.scm
> +++ b/src/cuirass/scripts/remote-server.scm
> @@ -376,7 +376,10 @@ directory."
> (when (> duration 60)
> (log-message "fetching '~a' took ~a seconds."
> drv duration)))))
> - (register-gc-roots drv)
> + ;; The derivation may have been GC'ed by that time. Do not try to
> + ;; register its outputs in that case.
> + (when (file-exists? drv)
> + (register-gc-roots drv))
I think it’s be safer (less prone to TOCTTOU races) to write it as:
(catch 'system-error
(lambda ()
(register-gc-roots drv))
(lambda args
(unless (= ENOENT (system-error-errno args)) ;collected in the meantime
(apply throw args))))
Ludo’.
- Re: branch master updated: remote-server: Fix fetch worker crash.,
Ludovic Courtès <=