all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Mathieu Othacehe <othacehe@gnu.org>
Cc: Guix Devel <guix-devel@gnu.org>
Subject: Re: branch master updated: remote-server: Fix fetch worker crash.
Date: Sun, 05 Dec 2021 22:19:55 +0100	[thread overview]
Message-ID: <87o85uu4uc.fsf@gnu.org> (raw)
In-Reply-To: <20211203093835.634.3648@vcs0.savannah.gnu.org> (Mathieu Othacehe's message of "Fri, 03 Dec 2021 04:38:35 -0500")

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


       reply	other threads:[~2021-12-05 21:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20211203093835.634.3648@vcs0.savannah.gnu.org>
2021-12-05 21:19 ` Ludovic Courtès [this message]
2021-12-06  8:50   ` branch master updated: remote-server: Fix fetch worker crash Mathieu Othacehe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o85uu4uc.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=othacehe@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.