From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id MGB2ITauuWLs7wAAbAwnHQ (envelope-from ) for ; Mon, 27 Jun 2022 15:18:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 2JJvIDauuWLAGQEAG6o9tA (envelope-from ) for ; Mon, 27 Jun 2022 15:18:46 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 46756E89C for ; Mon, 27 Jun 2022 15:18:46 +0200 (CEST) Received: from localhost ([::1]:58688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5odY-0000P7-Jb for larch@yhetil.org; Mon, 27 Jun 2022 09:18:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5odA-0008VQ-MH for guix-devel@gnu.org; Mon, 27 Jun 2022 09:18:20 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:18282) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5od8-00069V-Ht for guix-devel@gnu.org; Mon, 27 Jun 2022 09:18:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=YNteVBE3pCCGh2YjdqSwdGFMtspoJkYtUFbLGMP1BSs=; b=qn8RfZzBiscIYS1mgMPBIKwk9GmTxgbYWzzUwK8e71zBZp3Jr08NT+XE eNDVm4xaQvXaIwQS6qhjFO45if3xj2M7E5VpUuU+zSuAG0F0TTswFHRtY nGM7GoDgN3rLOkCC7UsC40SdRmmwHpTdeu/MzlEpO8bo5K5ibDB5sha14 M=; X-IronPort-AV: E=Sophos;i="5.92,226,1650924000"; d="scan'208";a="17874779" Received: from unknown (HELO ribbon) ([193.50.110.235]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2022 15:18:16 +0200 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Guix Devel Subject: [Shepherd] Service monitoring agent X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Nonidi 9 Messidor an 230 de la =?utf-8?Q?R=C3=A9volu?= =?utf-8?Q?tion=2C?= jour de l'Absinthe X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 27 Jun 2022 15:18:15 +0200 Message-ID: <87czeugs88.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=192.134.164.104; envelope-from=ludovic.courtes@inria.fr; helo=mail3-relais-sop.national.inria.fr X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1656335926; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=YNteVBE3pCCGh2YjdqSwdGFMtspoJkYtUFbLGMP1BSs=; b=bZdrhf1VgSBNHlpwBQrf59fDW0NDiJaWLVRsvB9eBAAMYD1M07EgSj4PFDTpmOWqMEU5Sl eYyBuT3+jneVlrmtihhLHobisipZnWxfThL2mOvx6ab5QaFAxb5G8BP5+TsSkc0yjrcqAu sztZYXlTho6Q40FQWO0ca/wYHCz0NNUGkAQhzjxhR+pHIlLpZxYoFwFgjwIqM0SWLFQ38v Op02Cz0AH6yEhhgVeaveElBdeTJRYjcN5c9ep3DYWiCIv3WkyBL2omDxceVMtGWVFEmEn6 b23mDzHDCXOYdTWrhs2Bjh6+qJfwVcZ4Ba+XUR8iY5yw49rc+ZpitrTW6DfYFg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1656335926; a=rsa-sha256; cv=none; b=M0gDPE3MKQM3Z0t0PhVb3DS7XV931uchttLMwAH/ncN627S9DuZ6cC8sKO63e024yehFAx iTP+Js31pLiQWFdNH8N813JTbaxmlcflSb6YC99R0YLoMuBoIk1exV79ZxooN4SFVc5GGO Cui7XpSP1BKr5sy4ncAc+aRlhtpSgDPBIZFHNM4NNNZoJ/kZlmWuLwCLCFZNwPJCBL2ibi nfGrbwL17Z6tlATVWyeOzvfSUX0ztOHRaoh0mwHXsNkVBIgYHqYrco+Y+8zg7PnFdO80wp 6YoKTAXY+5R0T/KbjRuPst/2w3t1THnwPM/Xb3OycqelJODHAEbrnANn//XqEA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=inria.fr header.s=dc header.b=qn8RfZzB; dmarc=pass (policy=none) header.from=inria.fr; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -6.45 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=inria.fr header.s=dc header.b=qn8RfZzB; dmarc=pass (policy=none) header.from=inria.fr; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 46756E89C X-Spam-Score: -6.45 X-Migadu-Scanner: scn0.migadu.com X-TUID: tFt1pg3F+03B Hello Guix! I recently pushed a Shepherd branch called =E2=80=98wip-service-monitor=E2= =80=99: https://git.savannah.gnu.org/cgit/shepherd.git/log/?h=3Dwip-service-monit= or It creates a =E2=80=9Cservice monitoring agent=E2=80=9D=E2=80=94code that r= uns in a separate fiber and encapsulates the current state of services: registered, running, etc. Currently, state is managed directly within objects, for instance with the =E2=80=98running=E2=80=99 slot; this approach would repla= ce 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 =E2=80=9Cbeing started=E2=80=9D. Curre= ntly, we can only distinguish between =E2=80=9Crunning=E2=80=9D and =E2=80=9Cstopped=E2= =80=9D services; the monitoring agent has been augmented to handle a =E2=80=9Cstarting=E2=80=9D = 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=E2=80=99s 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=E2=80=99s still state in , such as respawn ti= mes, that we could move to the monitor. Feedback welcome! Ludo=E2=80=99.