GNU bug report logs - #73494
[PATCH 0/2] tmpfs /run.

Previous Next

Package: guix-patches;

Reported by: Hilton Chain <hako <at> ultrarare.space>

Date: Thu, 26 Sep 2024 07:03:02 UTC

Severity: normal

Tags: patch

Full log


Message #146 received at 73494 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: Vagrant Cascadian <vagrant <at> debian.org>, Hilton Chain <hako <at> ultrarare.space>,
 73494 <at> debbugs.gnu.org, Z572 <zhengjunjie <at> iscas.ac.cn>
Subject: Re: [bug#73494] [PATCH v4 1/3] services: activation: Continue on
 exceptions.
Date: Fri, 02 May 2025 18:17:23 +0200
Hello,

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:

> From: Hilton Chain <hako <at> ultrarare.space>
>
> Use ‘invoke’ for backtraces and avoid changing environment.
>
> * gnu/services.scm (activation-script): Execute activation scripts in
> ‘invoke’.
> Warn about failed activation scripts.
>
> Change-Id: I89be31433fbb46d0c4a9dc6115ab167910840b6f
> Signed-off-by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

[...]

>                        ;; Run the services' activation snippets.
> -                      ;; TODO: Use 'load-compiled'.
> -                      (for-each primitive-load '#$actions)))))
> +                      (for-each (lambda (action)
> +                                  ;; Don't block activation process when one
> +                                  ;; action fails.
> +                                  (catch #t
> +                                    (lambda ()
> +                                      (invoke action))
> +                                    (lambda _
> +                                      (warning
> +                                       (G_ "failed to activate '~a'.~%")
> +                                       action))))
> +                                '#$actions)))))

As I suggested upthread (or elsewhere? I’m lost!), I think it would be
enough to keep loading these files in the main process (as opposed to
spawning one short-lived process for each activation) and simply catch
exceptions:

  (for-each (lambda (file)
              (guard (c …)
                (save-module-excursion
                  …)))
            '#$actions)

I think it would do what we want while avoiding the overhead.  I don’t
think it qualifies as “premature optimization” because it’s already in
place and the semantics are well-defined.

Thoughts?

Ludo’.




This bug report was last modified 34 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.