From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id EIKTIJ6ff2O6CwAAbAwnHQ (envelope-from ) for ; Thu, 24 Nov 2022 17:45:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id OA7BIJ6ff2PtegEA9RJhRA (envelope-from ) for ; Thu, 24 Nov 2022 17:45:18 +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 0838D38B0F for ; Thu, 24 Nov 2022 17:45:17 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyFLU-0007LJ-BI; Thu, 24 Nov 2022 11:45:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyFLS-0007Kn-ND for bug-guix@gnu.org; Thu, 24 Nov 2022 11:45:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oyFLS-0001fH-Ej for bug-guix@gnu.org; Thu, 24 Nov 2022 11:45:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oyFLS-00022Q-AI for bug-guix@gnu.org; Thu, 24 Nov 2022 11:45:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#30948: [PATCH core-updates] guix: Reap finished child processes in build containers. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 24 Nov 2022 16:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30948 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Cc: 30948@debbugs.gnu.org, Carlo Zancanaro Received: via spool by 30948-submit@debbugs.gnu.org id=B30948.16693082767785 (code B ref 30948); Thu, 24 Nov 2022 16:45:02 +0000 Received: (at 30948) by debbugs.gnu.org; 24 Nov 2022 16:44:36 +0000 Received: from localhost ([127.0.0.1]:59911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyFL2-00021U-2K for submit@debbugs.gnu.org; Thu, 24 Nov 2022 11:44:36 -0500 Received: from mail-qk1-f180.google.com ([209.85.222.180]:33307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyFL0-00021I-Fk for 30948@debbugs.gnu.org; Thu, 24 Nov 2022 11:44:34 -0500 Received: by mail-qk1-f180.google.com with SMTP id x21so1297004qkj.0 for <30948@debbugs.gnu.org>; Thu, 24 Nov 2022 08:44:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=CrT8c52zNHQI5C47jEmoAd8qF9LOz0f/cfKrzQ3ZEAA=; b=P5aZI6yZgza3nsibP+r0TtPs0zSn1gTJpjASE/RnLVlQW+eT+z8/8q6zkWPQEdsvrr t3+UJj0L+nevfEvdjfpIfFtIis0ite4MTMoPsOZdKmw21gK3u4jTtSTjygZxf4D9lblp gGHIaImsi/j3p8ChUZ+IrOOfxnUDmjSmhoPyjo9j9XPSJ8uZpi2nViJpkEa32FNjqiXb W6xIeXOXqCaWOmA/UInC/ZmaK/OtxOdBHdUqLu8z8kDzjElXiHfQpL+m0sJXuuXjo9nx AUK9lWhwMbeifx/RbyTqxc0BoM+1BMDhbldvMUBtnRpQzkiIvOcpWB/lS//NhdrO11NK gGuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=CrT8c52zNHQI5C47jEmoAd8qF9LOz0f/cfKrzQ3ZEAA=; b=A18FvCR/jF9WKM3pcIoq4H28TboTxdtepdjsn1lSdzQ9/B3wVENaqwRaPfI9IASe46 oWyIYm/eNonYqE+G2NKRx0PQn5MxI1YKOPty5rW4ABHRiS+N8LKwqlQBUSyvqrhOBlQP HDyD4dDuuj2KS420IpO359gvSpGiq/l6qJ1f3Et4Js8Jla8Oqlgu+ApZL6tE7QqOKlWA ln0nuECrlIX+qhiQqJ+TxeBYl5g0tscj3pmwboy+qFCtou3MijnSAJzYKZ2//baoJQ3y 5jZRKPBxaXqUqzjU5E4gbyd+QoVYyAIJiT+D/AeD8Lh2XHh86OzoBs9tjEtiRn+OTRvx Wuqg== X-Gm-Message-State: ANoB5pnXhykB8e/vwJg+nhDt/O5k/ycY7HajFhjrUCAq9i8XzP8S1Hnt CvJncXvNT6AwKNMW9L18+XmHxf0xJBE= X-Google-Smtp-Source: AA0mqf7lsEcJg1VsE9Lj/F6B0nczCCeJwx3Af5nfuUqsE/CF2QhHbgBTxtEtVPeOqUWMzOD9hVRVYQ== X-Received: by 2002:a05:620a:a59:b0:6fa:349b:7ba9 with SMTP id j25-20020a05620a0a5900b006fa349b7ba9mr30456450qka.339.1669308268710; Thu, 24 Nov 2022 08:44:28 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1003]) by smtp.gmail.com with ESMTPSA id o17-20020ac872d1000000b003988b3d5280sm796010qtp.70.2022.11.24.08.44.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Nov 2022 08:44:28 -0800 (PST) From: Maxim Cournoyer References: <87muyvulwt.fsf@zancanaro.id.au> <87bmf6ve6u.fsf@gnu.org> <87sh8id1mg.fsf@zancanaro.id.au> <87vadeou54.fsf@gnu.org> <87o9j5x1d4.fsf@zancanaro.id.au> <874lkxoanq.fsf@gnu.org> Date: Thu, 24 Nov 2022 11:44:27 -0500 In-Reply-To: <874lkxoanq.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Fri, 30 Mar 2018 17:17:29 +0200") Message-ID: <87cz9cnvys.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1669308318; 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:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=CrT8c52zNHQI5C47jEmoAd8qF9LOz0f/cfKrzQ3ZEAA=; b=A/aiJKZsVj/MGbzc1kNnp3U0TLrp4CjlQslcaFNjrvbWIX5e7+q4nCvzUQ2h9JENipqdye cDCfVGq+GoyyaqcipaCB1S9arXJvl1sOwYuUGIXE+8aE2vSAqL4D+DSfl0lfjQxTSk23qH u3PZAHz5i6XcL/ywR2g2+u8nwywm3R2wGAGl3mUDbk4GD6Hcz28eA/iydml7eAJ3AHMx6C 0mckx5mb3J73UU0Z/qKvnzW2bhtjw24FjYcRK9rAezMCWgFZotvWwi6nEuqiUmQ5RiFWdB KG8QAXRpfViA5tbFgubu15IglElUAOhF7nkocF3luFIGgSXIXkJ6ncaX26IZcA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1669308318; a=rsa-sha256; cv=none; b=dWNesQc6LouW7QRZFvaiPd2UG2iK2SHaF2w7k24tATie8TFXiyoS6QErMe/Fc8BaOHShF2 d15QnozvRTcrTdztaypVJNVToRGL7Ijl35GUPDQzsEV+sQerwCxTAyyEcHMvEbw4Uh/yQ5 Mr6dkbUfpP1Bl0i5fyYfjV0xXTFmYFIhE41joJWGzpc+crdnykpaUGHgLYNXnZ5yD+Z9ci KNl3AOuUaEFuD8Z2ON3I2EDwNWNqyQVdyLWaPtFzEuDiAMnwi2fkU+Jkyk8pYejxxpxjcr aBCLeutgGwfpJ8wkneIGDFsrAWCAc75b64OstbeSoioudzfz8A5lXm5WjO59hQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=P5aZI6yZ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 7.01 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=P5aZI6yZ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 0838D38B0F X-Spam-Score: 7.01 X-Migadu-Scanner: scn0.migadu.com X-TUID: f6yBUs3DRPu0 Hi, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hello, > > Carlo Zancanaro skribis: > >> On Fri, Mar 30 2018, Ludovic Court=C3=A8s wrote: >>>> From what I can understand it's one of pid 1's responsiblities to >>>> reap child processes, so I would expect this to be set up for every >>>> builder, before the builder is run. >>> >>> True, but for derivations it=E2=80=99s also =E2=80=9Coptional=E2=80=9D = because eventually >>> guix-daemon terminates all its child processes. >> >> As long as the build process doesn't rely on behaviour that, strictly >> speaking, it should be allowed to rely on. It's not an issue of >> resource leaking, it's an issue of correctness. > > Right. > >>>> Given it's not specific to the gnu-build-system, I don't think it >>>> really fits there. For what it's worth, I agree. The evaluation container should have the correct signal handling configured for *any* code about to be evaluated, not just when on demand, if we want to fix this fully in a way that won't come back to haunt us in some edge case. >>> Yes, but note that it would be inherited by all the build systems. >> >> Except for trivial-build-system, which is probably fine. I still don't >> think it fits in a specific build system, given it's a behaviour that >> transcends the specific action happening within the container. >> >> Putting it in gnu-build-system will solve the problem in all realistic >> cases, so that's probably fine. It's still subtly incorrect, but will >> only be a problem if something using the trivial build system relies >> on pid 1 to reap a process, or if we make a new build system not >> deriving from gnu-build-system (which seems unlikely, but not >> impossible). > > I agree, every Guile process running as PID=C2=A01 should reap processes. Agreed too. > My view is just that this mechanism belongs in =E2=80=9Cuser code=E2=80= =9D, not in the > low-level mechanisms such as =E2=80=98build-expression->derivation=E2=80= =99 and > =E2=80=98gexp->derivation=E2=80=99. It=E2=80=99s a matter of separation = of concerns. Why? On my Guix System, such signal handling is handled by Shepherd, if I'm not mistaken. As I user, I can trust the foundation to be sane, rather than having to provide the bits to make it so myself. > Of course we don=E2=80=99t want to duplicate that code every time, but th= e way > we should factorize it, IMO, is by putting it in a =E2=80=9Cnormal=E2=80= =9D module that > people will use. > > Putting it in gnu-build-system is an admittedly hacky but easy way to > have it widely shared. I think we can do better than hacky here :-) --=20 Thanks, Maxim