all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: branch master updated: remote-server: Fix fetch worker crash.
       [not found] <20211203093835.634.3648@vcs0.savannah.gnu.org>
@ 2021-12-05 21:19 ` Ludovic Courtès
  2021-12-06  8:50   ` Mathieu Othacehe
  0 siblings, 1 reply; 2+ messages in thread
From: Ludovic Courtès @ 2021-12-05 21:19 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: Guix Devel

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’.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: branch master updated: remote-server: Fix fetch worker crash.
  2021-12-05 21:19 ` branch master updated: remote-server: Fix fetch worker crash Ludovic Courtès
@ 2021-12-06  8:50   ` Mathieu Othacehe
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Othacehe @ 2021-12-06  8:50 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix Devel


Hey Ludo,

> 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))))

Oh, indeed! Fixed with 6dcf2f65cea920b9b1c265de3e2b0abe0048a08e.

Thanks,

Mathieu


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-06  8:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20211203093835.634.3648@vcs0.savannah.gnu.org>
2021-12-05 21:19 ` branch master updated: remote-server: Fix fetch worker crash Ludovic Courtès
2021-12-06  8:50   ` Mathieu Othacehe

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.