guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#54205] [PATCH Shepherd] Factor out a public CALL-IN-FORK.


From: Ludovic Courtès
Subject: [bug#54205] [PATCH Shepherd] Factor out a public CALL-IN-FORK.
Date: Wed, 02 Mar 2022 17:05:26 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hi,

Maxime Devos <maximedevos@telenet.be> skribis:

> Attila Lendvai schreef op di 01-03-2022 om 08:06 [+0100]:
>> their service is started.  One such example is calling setrlimit from a start
>> action to set NOFILE (the open files limit), before the service is exec'ed 
>> and
>> thus inherits this value from the parent process, i.e. from Shepherd.
>
> 'fork+exec-command' already accepts a 'environment-variables' and
> 'file-creation-mask', how about adding an 'open-file-limit' argument?
> To me, that seems more declarative and less fragile than having
> to call 'call-in-fork' manually in a 'start' procedure (*).

Seconded.

> Support for other rlimits can be added on an as-needed basis.
> Alternatively, the argument could be generalised to a more general
> 'rlimit' argument:
>
>   #:rlimits
>   `((,RLIMIT_AS ,SOFT ,HARD)
>     (,RLIMIT_NPROC ,SOFT ,HARD)
>     (,RLIMIT_NOFILE ,SOFT ,HARD))
>
> WDYT?

This interface brings more flexibility, I’m all for it.

> (*) E.g., one of the ideas for making shepherd faster, was using some
> kind of multi-threading.  Forking when multi-threading is ill-defined

I think what we need is concurrency, not POSIX threads.  IOW, we can
achieve the concurrency we need without resorting to POSIX threads, for
example using Fibers on a single POSIX thread.

Thanks,
Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]