From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 24 11:44:36 2022 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 To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: bug#30948: [PATCH core-updates] guix: Reap finished child processes in build containers. 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=22'?= =?utf-8?Q?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-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30948 Cc: 30948@debbugs.gnu.org, Carlo Zancanaro X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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