unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludovic.courtes@inria.fr>
To: Guix Devel <guix-devel@gnu.org>
Subject: [Shepherd] Service monitoring agent
Date: Mon, 27 Jun 2022 15:18:15 +0200	[thread overview]
Message-ID: <87czeugs88.fsf@inria.fr> (raw)

Hello Guix!

I recently pushed a Shepherd branch called ‘wip-service-monitor’:

  https://git.savannah.gnu.org/cgit/shepherd.git/log/?h=wip-service-monitor

It creates a “service monitoring agent”—code that runs in a separate
fiber and encapsulates the current state of services: registered,
running, etc.

Currently, state is managed directly within <service> objects, for
instance with the ‘running’ slot; this approach would replace that.  The
expected benefits are: improved clarity through separation of state from
config, and finer-grain view of service state.

The first visible application (and original motivation) is a
representation of services that are “being started”.  Currently, we can
only distinguish between “running” and “stopped” services; the
monitoring agent has been augmented to handle a “starting” state.  It
provides a synchronization mechanism that makes sure that (start S)
blocks until S has been started, in case it was already being started
(that’s the semantics we had pre-0.9 but 0.9 broke that.)

The service monitor is a fiber that answers requests on a dedicated
channel, similar to a client/server model with remote procedure calls
(RPCs).  That way, all accesses to service state are serialized.

At this point, there’s still state in <service>, such as respawn times,
that we could move to the monitor.

Feedback welcome!

Ludo’.


                 reply	other threads:[~2022-06-27 13:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87czeugs88.fsf@inria.fr \
    --to=ludovic.courtes@inria.fr \
    --cc=guix-devel@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).