From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 9YUnJaOFP2KhugAAgWs5BA (envelope-from ) for ; Sat, 26 Mar 2022 22:29:07 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id sJh3IaOFP2KMagEA9RJhRA (envelope-from ) for ; Sat, 26 Mar 2022 22:29:07 +0100 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 DB1D54437D for ; Sat, 26 Mar 2022 22:29:06 +0100 (CET) Received: from localhost ([::1]:52562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nYDy6-0000Xr-3R for larch@yhetil.org; Sat, 26 Mar 2022 17:29:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYDxp-0000Xf-CZ for guix-devel@gnu.org; Sat, 26 Mar 2022 17:28:49 -0400 Received: from [2001:470:142:3::e] (port=60974 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYDxp-0007mx-4A; Sat, 26 Mar 2022 17:28:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=/zHQ1UwnRcLtL5Fotu0SJdeB+A49Ze+OqDdUrssrC0Y=; b=f/VUszJJ5K0uCc4/aVYn CORmiUiAdEBrj5lnI2mz+2bEkM8rdXT1V5842IzkvBABjQxuXTBBWb1VmOmswwrnhvaD5PmMvMSF0 aa6NRVK0KeRmpCCT3I357fKCI5/iVPzJFWY6aEVyZHvhbfSmKkPAB0U/5UGGK2cjbyHzgiUuYT/rv aemQ+h5PFIoJgPt7h+lthbaGK40Y3E9ETxscpRkMs0zUVEBqO1+kcHt8NsbP19wUKPnA59Q2fQ2zR 2JODJMxWUddBkyfWLk/IPAgYH6tbc2ESnHDuQJhEZy+1ZINgupraE/dFHzGM05aQZcM5qetI9H9Ox meQ53XC6t1VeQA==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=51164 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYDxo-0000kU-Iq; Sat, 26 Mar 2022 17:28:48 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: The Shepherd on Fibers References: <87ee2sfg9d.fsf@inria.fr> <87cziai2je.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 6 Germinal an 230 de la =?utf-8?Q?R=C3=A9volution?= 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: Sat, 26 Mar 2022 22:28:46 +0100 In-Reply-To: <87cziai2je.fsf@gmail.com> (Maxim Cournoyer's message of "Fri, 25 Mar 2022 09:29:09 -0400") Message-ID: <87h77k5rox.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: , Cc: guix-devel@gnu.org 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=1648330146; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=/zHQ1UwnRcLtL5Fotu0SJdeB+A49Ze+OqDdUrssrC0Y=; b=hPs04pd9FNszdwUTx5g6wA2B8st60Mv+IIsgoxfJhWWstfYBa0DXLnbRMiEGOxVi1JQMbY S9FPw/PHW1DOz4I+ExnVhHwMUhibeAbHIXb1+CAZgYcUb5MxMNyHnrnk/MWJQIBpkFnIjl CGCibg7rkplUmOcFzEUYowmE42yoclCO2hLcOh7GjKYEYAquhjHCXvZbcSPaqA4nRZR6oz xdX8Lj7YwtVrkIfXKPFNRDFbRx3FJjo5ZvbqDc+t1gcOW36mDfManx66lHGaxM1F0KxeJa bMuyCiLyPPSvunkl5nJlBuwnfGJignq/nK9wEXswS9rMM3+czE6yss4ljjArgQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1648330146; a=rsa-sha256; cv=none; b=ZQDkpDlihBVktnBesvv8rSLheS/D4idUZLansru0WbmpUewAFIKvWk9Uas1YZTlb1svtAi KDneQ5IXLDT+cl1PyFNFwOApibbZOohHslP/YjPy0s5mpAI08FVE6w3gW+4lNYcCS8WMk1 OPU3KlkiWmbWxxBAB9aYr+tU37xsBVlzFVUstpvUhkCNppSDju33iohSdcYlC3mt4gIbuw 4l4Mu0+hUOGIAWJh+lnuPAWGRSdc96CMFmftMzldWDfLcXUCHyWml7CHdPWWo8d1BdBlOO bphJSE/ILVvgICOcIv1pfjN9jTX7Vjg44n+S5ZoCnOfXLFSmGg4CCYkchNJ/JA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b="f/VUszJJ"; dmarc=pass (policy=none) header.from=gnu.org; 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: -9.88 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b="f/VUszJJ"; dmarc=pass (policy=none) header.from=gnu.org; 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: DB1D54437D X-Spam-Score: -9.88 X-Migadu-Scanner: scn0.migadu.com X-TUID: QoU+y2fPEkoP Hi Maxim! Maxim Cournoyer skribis: >> The goal is to make shepherd (the daemon) use Fibers=C2=B9 for concurren= cy. > > Very exciting work! I can't wait to have my 5 min boot reduced (mostly > busy-waiting on the child-hurd VM to start) ;-). Same here! The childhurd service will need some help as it=E2=80=99s curre= ntly written in a way that would block. > Interesting; in a (unmerged) patch I had made to mcron, I had extended > the select loop in a way that it'd detect available output and use a > suspendable port to accomplish this; perhaps Fibers would be a > cleaner/more straightforward way to accomplish this. Also, I was > particularly happy about how flexible the timestamp/metadata prefixed to > each line could be configured by a user; you may want to steal ideas > from it! [0] > > [0] https://lists.gnu.org/archive/html/bug-mcron/2021-08/msg00008.html Oh nice! I hope that patch will eventually make it into mcron (or we could use our own version!). For the timestamp format there=E2=80=99s currently a parameter, which is not exposed, and defaults to syslog style. > I see. I was puzzle by this configure.ac check: > > +dnl Check for extra dependencies. > +GUILE_MODULE_AVAILABLE([have_fibers], [(fibers)]) > +if test "x$have_fibers" !=3D "xyes"; then > + AC_MSG_ERROR([Fibers is missing; please install it.]) > +fi > + > +dnl Make sure Fibers does not create POSIX threads: since shepherd > +dnl forks, it must be single-threaded. > +AC_CACHE_CHECK([whether Fibers might create POSIX threads], > + [ac_cv_fibers_creates_pthreads], > + [GUILE_CHECK([retval], > + [(use-modules (fibers)) > + (set! (@ (ice-9 threads) call-with-new-thread) > + (lambda _ (throw 'new-thread!))) > + (run-fibers (lambda () (spawn-fiber (lambda () 1))) > + #:parallelism 1 #:hz 0)]) > + if test "$retval" =3D 0; then > + ac_cv_fibers_creates_pthreads=3D"no" > + else > + ac_cv_fibers_creates_pthreads=3D"yes" > + fi]) > +if test "x$ac_cv_fibers_creates_pthreads" =3D "xyes"; then > + AC_MSG_ERROR([Fibers creates POSIX threads behind our back; aborting.]) > +fi > > > In which scenario would Fibers create unwanted POSIX threads? It shouldn=E2=80=99t happen with #:parallelism 1 #:hz 0. Here I=E2=80=99m = just being super defensive: it=E2=80=99s PID 1 after all, and if future Fibers versions break that assumption for some reason, I=E2=80=99d rather detect it early. > 1. In fae59fb * build: Capture the source and object directories of > Fibers. > > Why must we even capture the Fibers source/compiled objects directories? We don=E2=80=99t have to, but if we don=E2=80=99t do it here, then the =E2= =80=98shepherd=E2=80=99 package definition will have to use =E2=80=98wrap-program=E2=80=99 to do it= for us. Since there=E2=80=99s just one dependency, I thought we might as well do it upstream. > 2. nitpick; in "service: 'read-pid-file' no longer blocks": > > -;; Copyright (C) 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Lu= dovic Court=C3=A8s > +;; Copyright (C) 2013-2022 Ludovic Court=C3=A8s > > While I agree this reads better, I've recently stumbled in info > '(maintain) Copyright Notices' on: > > You can use a range (=E2=80=982008-2010=E2=80=99) instead of listin= g individual years > (=E2=80=982008, 2009, 2010=E2=80=99) if and only if: 1) every year in = the range, > inclusive, really is a =E2=80=9Ccopyrightable=E2=80=9D year that would= be listed > individually; _and_ 2) you make an explicit statement in a =E2=80=98RE= ADME=E2=80=99 file > about this usage. > > So you'd want to add an explicit statement in the README about it. Yes, will do (it=E2=80=99s typical FSF pedantry; I remember the time it took before this anecdotal-looking paragraph would end up in that document, as if software freedom was at stake :-)). > 3. I was a bit skeptical about the ability to configure the encoding of > the log file; in which situation would switching it to something else > than UTF-8 be useful? I agree; the log files produced by shepherd are always UTF-8. What=E2=80=99s configurable is the encoding of the data produced by daemons. It=E2=80=99s probably rarely useful, but if you have a daemon that writes, = say, ISO-8859-1 strings, you can say so. That way, the output of that daemon is properly decoded as ISO-8859-1; the log file produced by shepherd remains UTF-8 no matter what. Thanks for taking a look! Since that initial message I added support for inetd-style service startup. Among the services I use, it could be use for sshd (OpenSSH), bitlbee, and dicod. More on that later=E2=80=A6 Ludo=E2=80=99.